System for data management in a large scale data repository

ABSTRACT

A computer-implemented method of managing data in a data repository is disclosed. The method comprises maintaining a data repository, the data repository storing data imported from one or more data sources. A database entity added to the data repository is identified and a metadata object for storing metadata relating to the database entity is created and stored in a metadata repository. The metadata object is also added to a documentation queue. Metadata for the metadata object is received from user via a metadata management user interface and the received metadata is stored in the metadata repository and associated with the metadata object.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/704,553, entitled SYSTEM FOR DATA MANAGEMENT IN A LARGE SCALE DATAREPOSITORY, filed Sep. 14, 2017, which claims priority to United KingdomPatent Application No. 1615747.1, entitled SYSTEM FOR DATA MANAGEMENT INA LARGE SCALE DATA REPOSITORY, filed Sep. 15, 2016, all of which areincorporated herein by reference.

BACKGROUND

The present invention relates to systems and methods for importing andmanaging data in a large scale data repository. Particular aspectsrelate to import processes, data relationship discovery and metadatacollection.

Organizations maintain increasingly large and complex collections ofdata. Often there is a need to bring together data from diverse datasources into a central data repository to enable processing and analysisof data sets. However, this presents a number of technical challenges.For example, important information about the structure and content ofsource databases may be lost during import, making it harder to accessand manage the data efficiently. Furthermore, the exploitation of thedata can be hampered by inconsistencies in data definitions acrossdifferent sources, and the complexity of data sets often means thatexpert knowledge is required to access and manipulate the data, e.g. bycreating data queries. As a result, making such data sets accessible toordinary users in an efficient manner has in the past has presentedsignificant technical difficulties.

SUMMARY

Embodiments of the present invention accordingly seek to addressdeficiencies in existing data processing systems.

Accordingly, in a first aspect of the invention, there is provided acomputer-implemented method of managing data in a data repository,comprising maintaining a data repository, the data repository storingdata imported from one or more data sources; identifying a databaseentity added to the data repository; creating a metadata object forstoring metadata relating to the database entity and storing themetadata object in a metadata repository; adding the metadata object toa documentation queue; receiving, from a first user, metadata for themetadata object via a metadata management user interface; and storingthe received metadata in the metadata repository and associating themetadata with the metadata object.

The receiving step may comprise accessing the metadata object by thefirst user from the documentation queue. Preferably, the user accessesthe metadata object using a queue interface displaying metadata objectsof the documentation queue. The method may comprise assigning themetadata object to the first user prior to the user accessing themetadata object to enter metadata.

Identifying the database entity preferably comprises: determining datastructure information (or schema information) relating to data stored inthe data repository; comparing the data structure information tometadata in the metadata repository (e.g. to identify data entities forwhich no metadata object exists in the metadata repository); andidentifying the added database entity based on the comparison.

The identifying step may be performed by a synchronization modulearranged to synchronize the metadata repository with the datarepository. The synchronization module may further be configured todetect changes to or removal of database entities in the datarepository, and update the metadata repository accordingly (e.g. byadding or removing metadata objects or marking metadata objects asobsolete).

A metadata object is preferably associated with one or more first userpermissions indicating one or more users or user classes permitted toenter metadata for the metadata object, wherein the metadata managementuser interface enables entry of metadata for the metadata object by thefirst user if the first user matches the first user permission(s). Thus,the interface may not permit metadata editing by a user not identifiedas having editing permission for the metadata object.

The method may further comprise: after receiving the metadata, addingthe metadata object to an approval queue; receiving a positive ornegative approval indication for the metadata object from a second uservia the metadata management user interface; and in response to apositive approval indication, marking the metadata object as approved inthe metadata repository (and optionally removing the metadata objectfrom the approval queue). This may also make the metadata object and itsmetadata available for use in other modules or processes, e.g. a querybuilder tool. Negative approval is also referred to as a dispute of ametadata object.

The second user may access the metadata object from the approval queuee.g. via an approval interface. The metadata object may have beenassigned to the second user prior to access by the second user.

The method may comprise, in response to a negative approval indication,adding the metadata object to a dispute queue, the negative approvalindication preferably associated with dispute reason information enteredby the second user. The method may comprising receiving, from areviewing user in relation to a metadata object on the dispute queue: adispute-rejection indication, and in response returning the metadataobject to the approval queue for subsequent approval of the metadataassociated with the metadata object; or a dispute-upheld indication, andin response returning the metadata object to the documentation queue forsubsequent editing of the metadata associated with the metadata object.The first, second and reviewing users are preferably different users.

The metadata object may be associated with one or more second userpermissions indicating one or more users or user classes permitted toapprove the metadata object, wherein the metadata management userinterface enables entry of an approval indication for the metadataobject by the second user if the second user matches the second userpermission(s). Thus, the interface may not permit users not identifiedas permitted to approve a metadata object to provide an approvalindication. The second user permissions may specify one or more users oruser classes required to approve the metadata object, the methodcomprising marking the metadata object as approved only after receivinga positive approval indication from each specified required user and/orfrom a user of each specified required user class.

A metadata object is preferably associated with one or more metadataitems in the metadata repository. The method may comprise identifying atype of the database entity and/or metadata object, selecting aplurality of metadata items associated with the type in accordance withconfiguration data, and associating the selected metadata items with themetadata object. Thus different types of metadata object may havedifferent sets of metadata items associated with them. Each metadataitem may define the type(s) of metadata object to which it applies. Themethod may comprise providing, by the metadata management userinterface, a metadata input interface comprising the selected metadataitems.

Each metadata item may be associated with one or more user permissionsindicating one or more users or user classes permitted to edit and/orapprove the metadata item, the method comprising permitting editingand/or approval of a metadata object via the metadata management userinterface in accordance with the user permissions specified for itsmetadata items. Each metadata item may be associated with one or moreuser requirements indicating one or more users or user classes requiredto approve the metadata item, the method comprising marking a metadataobject as approved only after positive approval indications have beenreceived from each user or user class specified for the metadata itemsof the metadata object.

Metadata items may be associated with configuration data specifyingwhether a given metadata item is mandatory or optional, the methodcomprising adding the metadata object to the approval queue only afteruser input has been received for all mandatory metadata items definedfor the metadata object.

The method may comprise providing a metadata configuration interface fordefining metadata object types and/or metadata items, the interfacepreferably enabling configuration for a metadata item of one or more of:one or more metadata object types to which the metadata item relates; aset of users or user classes permitted to edit the metadata item; a setof users or user classes required to approve the metadata item; whetherthe metadata item is mandatory or optional.

Preferably, the method comprises providing a plurality of metadataobject types arranged in one or more hierarchies, the method preferablyfurther comprising a metadata browsing interface for displaying metadataobjects in accordance with the hierarchies.

Preferably, metadata objects correspond to database entities associatedwith the data in the data repository, including one or more of: datasources; tables; views; table columns; relationships; queries; andreports.

The identifying step may comprise analyzing data in the data repositoryto identify one or more relationships within the data, the methodcomprising creating metadata objects for the identified relationships inthe metadata repository and adding the metadata objects to thedocumentation queue. Identifying one or more relationships may comprisesevaluating a plurality of candidate relationships, each candidaterelationship defined between a first candidate key of a first datacollection and a second candidate key of a second data collection, theevaluating comprising, for each candidate relationship, computing one ormore relationship metrics, wherein the relationship metrics provide ameasure of a relationship between the first candidate key and the secondcandidate key; and identifying one or more relationships between datacollections in dependence on the computed relationship metrics.Evaluation and/or identification of relationships may be performed inaccordance with the further aspects of the invention as set out in theFurther aspects and features of the invention section below.

The method may further comprise importing data from the one or more datasources to the data repository using an automated data import process,and preferably further comprising adapting the automated data importprocess in response to changes in the source data schema of the importeddata. Imported data is preferably stored at the data source inaccordance with a source data schema, the method comprising: executingan automated data import process to retrieve data from the data sourceand update the target storage system based on the retrieved data, theautomated data import process operating in dependence on the source dataschema; detecting a change in the source data schema; in response todetecting the change in the source data schema, modifying the automateddata import process based on the detected change; and executing themodified automated data import process to retrieve further data from thedata source and update the target storage system based on the furtherretrieved data. The importing may be performed in accordance with thefurther aspects of the invention set out in the Further aspects andfeatures of the invention section below.

The method may comprise adding metadata objects to the metadatarepository and/or documentation queue in response to importing data, andpreferably automatically associating metadata with the metadata objectbased on the imported data and/or schema information of the data source.

The method may comprise providing a search interface for searchingmetadata in the metadata repository and/or providing a query builderinterface adapted to enable construction of a data query using metadatafrom the metadata repository.

The query builder interface may comprise an interface for selection ofdata entities used in the query, the interface displaying metadata fordata entities stored in the metadata repository and/or providing asearch interface for selecting data entities based on metadata in themetadata repository. The query builder interface may enable selectionof: one or more source tables for a query; and one or more tablerelationships between selected tables. The method may comprise creatinga data query based on the selected tables and relationships, preferablywherein a selected relationship is used to define a table join onselected tables. In response to receiving a selection of two tables asdata sources for the query, the method may include identifying based onstored metadata at least one relationship between columns of theselected tables, and providing an indication of the identifiedrelationships on the query builder user interface. The method maycomprise displaying an indication of the relationship strength on thequery builder interface. The identified relationships may comprise oneor more relationships automatically identified by analysis of data inthe data repository, the relationship strength indication preferablycomputed during the analysis. The analysis may be performed inaccordance with the further aspects of the invention as set out in theFurther aspects and features of the invention section below.

The method may further comprise executing the query and/or storing thequery, and preferably further comprises creating a metadata object forthe query in the metadata repository, and preferably adding the metadataobject to the documentation queue.

In a further aspect of the invention, there is provided a system formanaging data stored in a data repository, the system comprising: ametadata repository for storing metadata objects, the metadata objectscomprising metadata relating to data in the data repository; adocumentation queue adapted to identify metadata objects for whichmetadata is to be collected; an approval queue adapted to identifymetadata objects for which user approval is to be obtained; asynchronization module adapted to identify addition of one or moredatabase entities to the data repository, to create one or more metadataobjects based on the added database entities, and to add the createdmetadata objects to the documentation queue; a metadata collectionmodule adapted to receive metadata for metadata objects in thedocumentation queue, store the received metadata in the metadatarepository and associate the metadata with the metadata objects and tomove metadata objects for which metadata has been entered from thedocumentation queue to the approval queue; and a metadata approvalmodule adapted to receive approval indications for metadata objects inthe approval queue and to mark approved metadata objects in the metadatarepository as approved based on the received indications. The system ispreferably configured to perform any method as set out above or in anyof the further aspects of the invention set out in the Further aspectsand features of the invention section below.

More generally, the invention also provides a system or apparatus havingmeans, preferably in the form of a processor with associated memory, forperforming any method as set out herein, and a tangible, non-transientcomputer-readable medium comprising software code adapted, when executedon a data processing apparatus, to perform any method as set out herein.

Any feature in one aspect of the invention may be applied to otheraspects of the invention, in any appropriate combination. In particular,method aspects may be applied to apparatus and computer program aspects,and vice versa.

Furthermore, features implemented in hardware may generally beimplemented in software, and vice versa. Any reference to software andhardware features herein should be construed accordingly.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred features of the present invention will now be described,purely by way of example, with reference to the accompanying drawings,in which:—

FIG. 1 illustrates a system for importing data into a central datarepository and analyzing and managing the imported data;

FIG. 2A illustrates a high-level process for importing data from arelational database into a data lake;

FIG. 2B illustrates a process for managing data schemas during import;

FIG. 3 illustrates functional components of a metadata generator andschema evolution module;

FIG. 4 illustrates the operation of the metadata generator and schemaevolution module;

FIGS. 5A and 5B illustrate the use of automatically generated scriptsfor data import;

FIGS. 6A and 6B illustrate functional components of a table differencecalculator;

FIG. 7 illustrates the operation of the table difference calculator;

FIG. 8 illustrates an example of a table difference calculation;

FIG. 9 illustrates a table analysis process for automatic discovery ofrelationships between data tables;

FIGS. 10, 11, 12, 13, 14A and 14B illustrate the table analysis processin more detail;

FIGS. 14C-14H illustrate extensions of the table analysis algorithm;

FIG. 15 illustrates a metadata collection and management process inoverview;

FIG. 16 illustrates an alternative representation of the metadatacollection and management process;

FIG. 17 illustrates a work queue user interface for the metadatacollection and management process;

FIGS. 18A and 18B illustrate user interfaces for navigating andconfiguring an information hierarchy;

FIG. 19 illustrates a user interface for configuring an item ofmetadata;

FIG. 20 illustrates a metadata collection and/or approval userinterface;

FIG. 21 illustrates a user interface for viewing or editing datarelationships;

FIG. 22 illustrates a metadata synchronization process;

FIGS. 23A and 23B illustrate a query builder user interface;

FIG. 24 illustrates processes for creating, editing and documentingqueries using a query builder tool;

FIGS. 25A-25C illustrate software architectures for the data managementsystem; and

FIG. 26 illustrates an example of a hardware/software architecture of acomputing node that may be used to implement various describedprocesses.

DETAILED DESCRIPTION

Embodiments of the invention provide systems and methods for importingdata from a variety of structured data sources such as relationaldatabases into a large-scale unstructured or flexibly structured datarepository and for the management of the data after import. Such a datamanagement system is illustrated in overview in FIG. 1.

It should be noted that, in the following description, specificimplementation details are set out by way of example (for example inrelation to database and software technologies used and details of thesoftware architecture of the system—e.g. the use of Hadoop/Hive and Javatechnologies). These relate to an exemplary implementation of the systembut should not be construed as limiting, and alternative approaches andtechnologies may be substituted.

The data management system 100 provides a software component referred toas the “Data Tap” tool 106 for importing data from any number of datasources 102-1, 102-2, 102-3 into a data repository 108.

The data repository 108 is also referred to herein as a “data lake”, andmay comprise any data storage technology. Preferably, the data lakeallows data to be stored in an unstructured or flexibly structuredmanner. For example, the repository or data lake may not require a fixedor pre-defined data schema. The data lake may be (or may include) aNoSQL or other non-relational database, such as a document-orienteddatabase storing data as “document” data objects (e.g. JSON documents),a key-value store, a column-oriented database, a file system storingflat files, or any other suitable data store or combination of any ofthe above. However, in other embodiments, the data lake couldalternatively include a conventional structured database such as arelational database or object database.

In the examples described herein, the data lake is implemented as aHadoop data repository employing a Hadoop Distributed File System (HDFS)with an Apache Hive data warehousing infrastructure. Hive Query Language(HQL) is used to create and manipulate data sets in the HDFS to storedata extracted from the data sources 102.

The data sources 102-1, 102-2, 102-3 are illustrated as being structureddatabases (e.g. relational or object databases) but any form of datasource may be used, such as flat files, real-time data feeds, and thelike. In the following examples, the data sources are relationaldatabases managed by conventional relational database management systems(RDBMS), e.g. Oracle/MySQL/Microsoft SQL Server or the like.

A given source database 102 consists of a number of tables 104 (where atable comprises a set of rows or records, each divided into one or morefields or columns). The Data Tap tool may import a database in itsentirety (i.e. including all tables) or alternatively may import onlyone or more selected tables (e.g. as illustrated here, a subset oftables shown with solid lines have been selected for import fromdatabase 102-1). Furthermore, the system may import tables and data froma single data source 102-1 or from multiple data sources into the samedata lake 108. Thus, data that originated from differently structureddata sources having different original data schemas may coexist withindata lake 108 in the form of a collection of Hive tables 110.

In one example, imported table data may be stored in files in the HDFS(e.g. in Hadoop SEQUENCEFILE format). In practice, except possibly forvery small tables, a given source table may be split across multiplefiles in the HDFS. The Data Tap tool preferably operates in aparallelized fashion as a map-reduce algorithm (here implemented usingthe Hadoop Java map-reduce framework) and the number of files producedfor an imported table depends on how many mappers are used to create thefiles. As an example, for small tables a default of ten mappers may beused producing ten files for a table, but very large tables may be splitinto thousands of files.

The files are partitioned by row, each containing the full set ofcolumns imported from the source table (while typically all columns ofthe source table will be imported this need not always be the case).Additional columns of management data may be added to the importedtables for management purposes during import, for example to recordimport timestamps and the like. The files are placed in a directorystructure, such that the files associated with a single source tablepreferably reside in a common directory (e.g. with separate directoriesfor each source table, though alternatively files could be spread acrossmultiple directories e.g. depending on whether the tables arepartitioned at source).

The files are created by the Data Tap map-reduce algorithm inSEQUENCEFILE format. Apache Hive enables a database structure to beapplied to these files, such as tables and columns, and the structureinformation is stored in the Hive database known as the Hive Metastore.Thus, the term “Hive tables” is used to describe the table structuresthat are applied across the many files in a HDFS file system. A Hivetable is thus a collection of structured HDFS files with each filecorresponding to a partition of the source table comprising a subset ofthe rows of that table. Hive commands (using HQL) are available toaccess this data and also to update the table structure. HQL provides asimilar syntax to SQL.

In a preferred embodiment, the Hadoop platform is configured to maintaintwo operational databases; the first is referred as OPEN, and the otherCLOSED. OPEN stores a copy of the current source system tables, whereasCLOSED stores the full history of these source system tables includingdeleted records, and older versions of records which have since beenupdated.

The data in data lake 108 may be made available to external processes,e.g. analytics process 112 and reporting process 114. Thus, thedescribed approach can enable an organization to bring togetherinformation from many disparate databases (possibly supporting differentoperations of the organization), and analyze and process the datacentrally.

When importing data from many different data sources, knowledge of thecontents of the data tables and their interrelationships may be lost.Furthermore, it may often be the case that data imported from disparatedata sources is interrelated. For example, a gas or similar utilitiesprovider may import a database of gas supply accounts from a supply partof the organization and a database of boiler maintenance data from aservice/maintenance part of the organization. The data may be related inthat some supply customers may also be maintenance customers. Thus,there may be relationships between data in the multiple data sources,which may, for example, manifest in overlapping data items appearing inboth sets such as customer identifiers or names, addresses and the like.The above is merely one example, and similar relationships may occurbetween disparate data sources maintained by organizations within anyfield (e.g. medical, banking, manufacturing etc.)

It is not necessarily the case, however, that equivalent or related datafrom different data sources will reside in tables/columns having thesame or related names, and documentation for the source databases may beincomplete or inconsistent, making it difficult to work with the dataafter import. Furthermore, even where multiple tables are imported fromthe same data source, relationships between tables (which may e.g. bedefined in the form of metadata, queries, views or the like in thesource database) may be lost during the import process. This loss ofstructural information and knowledge about the data presents a technicalproblem that impairs subsequent handling of the data.

Embodiments of the present invention address such problems by providinga Table Analyzer software module 107 which can automatically discoverrelationships between Hive tables stored in the data lake 108 as well asMetadata Manager tool 109 providing a process for collating metadataabout imported data entities.

The Table Analyzer 107 uses algorithms employing a stochastic approachto identify relationships between table columns, based on theprobability of particular columns being keys for their tables, and thedegree of overlap between the data content of different columns. Suchrelationships may represent e.g. primary-foreign key relationships orany other relationships that may allow a table join operation to beperformed to combine data from different source tables. The identifiedrelationships may then be used in the creation of join queries tocombine and extract data from the data lake.

The Metadata Manager tool 109 implements processes for entry andmanagement of metadata relating to the data that has been imported intothe data lake. Together with the relationships discovered by the TableAnalyzer tool 107, the metadata can be used to assist in subsequent dataprocessing and extraction.

The following sections describe the Data Tap tool, Table Analyzer tooland Metadata Manager tool in more detail.

Data Tap

The Data Tap tool 106 comprises the following components:

1) Metadata Generation and Schema Evolution

2) Difference Calculator

3) History Capture

The Data Tap framework is flexible and provides the capability to ingestdata from any relational database into the Hadoop data lake. TheMetadata Generation and Schema Evolution tool not only provides thecapability to seamlessly deal with changes to the source schema, butalso provides the capability to automate the Hadoop development thatwould have been required to ingest additional tables and data from newdata sources (in some cases removing the need for humanintervention/development effort altogether).

The Difference Calculator is used for data sources that do not have thecapability to provide change data in an incremental manner.

The History Capture process provides the means of creating the OPEN andCLOSED partition for each day, containing the current data set andhistorical data respectively.

FIG. 2A illustrates the Data Tap import process in relation to aparticular table being imported from a given source database. Thedepicted process is repeated for each table to be imported.

The metadata generator and schema evolution process 202 retrieves andstores metadata for the table being imported and deals with changes tothe metadata. The metadata defines the schema of the table beingimported, i.e. the table structure and field definitions. The metadataextraction may be controlled by way of configuration files 204.

The metadata is used in a data extraction process 206 to extract datafrom the table in the source database. In the present example, Sqoopscripts are used to perform the extraction but other technologies may besubstituted.

The data extraction process reads the contents of the table from thesource database. The extracted data is stored in a temporary landingarea 208 within the data lake.

A re-sequencer and data cleansing process 210 (e.g. implemented usingHive commands or scripts) pre-processes the data and stores thepre-processed data in a staging area 212. Re-sequencing involveschanging the column order of a row to ensure that the columns which arekeys are the first ones in each row when stored in Hadoop which canimprove access efficiency. Cleansing involves other processing to placedata into the appropriate format for Hadoop, e.g. by removing spuriousdata, reformatting data etc. In one example, cleansing includes theprocess of removing erroneous spaces that are introduced when usingSqoop against an Oracle database (due to a known bug with Sqoop). Moregenerally, the re-sequencing/cleansing scripts can be used to configureother required data transformations, depending on application contextand specific needs. Preferably, the re-sequencer/data cleansing processalso generates table information files which store the table and columninformation of a file after the columns have been re-sequenced andcleansed.

If the import is a first run (check 214) for the given data source, e.g.the first time a particular table is imported, then the whole data setis moved to a landing area 218. If not, then a difference calculatorprocess 216 performs a difference calculation to identify thedifferences between the current table contents, as read in the dataextraction step 206, and a previously imported version of the sametable. The difference between the older version and the currentlyimported version (also referred to herein as the table delta) is thenstored in the landing area 218. Thus, the landing area 218 will containfull data for a table if this is the first time the table is imported orthe delta if the table had previously been imported.

A history capture process 220 then updates the Hive tables in the datalake. This involves both updating the current values as recorded in theOPEN database 224 and maintaining historical information in the CLOSEDdatabase 222. The history capture process is described in more detailbelow.

A control framework 230 manages the Data Tap workflows. In oneembodiment, this uses Unix shell scripting to manage the completeworkflow of the data import processes. The control framework preferablygives restart ability from any point of failure and provides logging anderror tracking functionality to all involved processes.

Note that the above example describes the use of a difference calculatorto generate a table delta for a previously imported table. However, insome cases the source database may be able to provide delta informationdirectly, in which case the difference calculator may not be needed.

FIG. 2B illustrates in more detail the process of importing a table 104from a source database into a Hive table 110 in the data lake. Theprocess starts in step 240 with the Data Tap tool connecting to thesource database. In step 242, the metadata for the table is extractedinto one or more metadata files 244. Data Tap then identifies whetherthe table is a new table (not previously imported) or a previouslyimported table in step 246. If the table is new then the correspondingHive table 110 is created in step 248 (e.g. by issuing a “Create Table”command), based on the extracted metadata defining the source table, andthe process proceeds to step 254 (see below).

If the table has previously been imported, then the extracted metadata244 is compared to existing metadata stored for the table in step 250 toidentify whether the metadata has changed in a way that requires changesto the Hive table 110 (note that not all schema changes in the sourcedatabase may require alterations to the Hive table, as discussed in moredetail below). Changes to the table schema may also necessitateregeneration of Sqoop and HQL data import scripts as described in moredetail below. If changes are required, then the Hive table is altered instep 252 (e.g. by issuing an “Alter Table” command). If the schema forthe source table (as defined in the metadata) has not changed, or anychanges do not require alteration to the Hive table, then the processproceeds directly to step 254.

In step 254, the Sqoop script for the table is run to extract the tabledata into temporary storage. Note that, for a previously imported table,the extracted data may be a delta of changes since the last export ifthe source database supports delta reporting, or the extracted data maybe the full table contents, in which case the difference calculator maybe run to identify any changes since the last import as described inmore detail below. In the case of a new table, the full table contentsare read by the Sqoop script.

The table data (either full table contents or a table delta) are theninserted into the Hive table 110 in step 256.

In a preferred embodiment, table information files 260 (“tableinfo”) arepreferably maintained and are used to store the column information forthe tables maintained in the Hadoop filesystem (after the tables havebeen re-sequenced and cleansed, e.g. to place key columns first in thecolumn order and remove any erroneous spaces between columns). The tableinformation files are updated in step 258 to reflect any changesdetected during import.

Metadata Generation and Schema Evolution

The Metadata Generation and Schema Evolution process 202 performs thefollowing functions:

-   -   Collection of metadata at runtime for any materialized RDBMS        tables in the source database    -   Creating tables in the Hadoop environment at runtime according        to the metadata    -   Identifying changes to metadata for the tables, at runtime,        which would affect the Hadoop environment    -   Applying schema changes for the tables to the Hadoop        environment, at runtime    -   Sqoop and Hive script generation at runtime according to the        table metadata    -   Regeneration of Sqoop and Hive scripts as necessary if schema        changes are identified

Ordinarily, to import data from any RDBMS system to Hadoop, bespokeimport scripts (e.g. using Sqoop) are written according to the dataschema of the tables being imported. However, writing the necessaryscripts is time consuming (in typical examples three or more developmentdays may be needed to add tables to the data lake for a new project,with additional time for quality assurance). This adds to theimplementation complexity and cost of projects. Furthermore, if theRDBMS data schema changes then similar development efforts are requiredto upgrade scripts used for import.

Embodiments described herein reduce or eliminate the development effortsrequired to ingest new RDBMS tables or deal with changes in sourcedatabase schemas.

The Metadata Generation and Schema Evolution process provides thefollowing functional components.

Metadata Generator—The metadata generator collects metadata ofmaterialized tables from any RDBMS system and stores the metadata in ametadata repository. The metadata is utilized to generate Sqoop/Hivescripts to import the data from the RDBMS to the Hadoop environment.

Schema Evolution—The schema evolution function identifies changes tometadata of materialized tables of any RDBMS. If any changes are foundwhich would affect the Hadoop environment for the table, the Hadoopenvironment is altered accordingly at runtime (and scripts areregenerated) with no system downtime or any manual preparation.

Archival of Metadata—Metadata is archived, including both metadatadescribing the initial data schema for a table (at first ingestion) andsubsequent changes. Preferably, the metadata is archived in such a waythat the table can be re-created from initial metadata and the sameschema evolution can be applied to it to evolve its schema to the latestschema. This may facilitate evolving schemas in development/testenvironments.

The Metadata generation and Schema evolution process is designed to usea common Java API to extract metadata for a table for any RDBMS.Preferred embodiments use the DatabaseMetaData Java API to retrievemetadata (and identify any changes to the metadata) for any RDBMSsource. If the schema for a table is changed at the data source theschema for the representation in the data lake is modified accordingly.

Schema discovery is performed dynamically. Dynamic schema discovery fromthe source system is carried out at run time and necessary actions areapplied to the data lake, if any. This can allow tables in existing datasources to be added to the data lake without any manual developmenteffort.

FIG. 3 illustrates core modules of the Metadata Generator and SchemaEvolution process.

The Metadata generator 302 reads metadata for a table from therelational database management system (RDBMS) of a data source 102 usingDatabaseMetaData APIs provided by Java, which provide a common platformto read metadata for different database sources. By way of example, thefollowing information is collected for each column of each table to beimported.

-   -   Table Name    -   Table Description    -   Source—This indicates the source system or database    -   Column name (this may need special handling while generating        Sqoop scripts if the column name cannot be used in the scripts,        in which case the column name is marked accordingly)    -   Sqoop column name—If a special case is identified for the column        name (see above) then the column can be re-named in the data        lake. The new name is recorded here.    -   Column Data Type    -   Column Description    -   Key type (if a column is part of index for a table, then this is        marked as ‘P’ for primary keys or else as ‘S’ for other types of        key). Other columns may be marked with particular flags; for        example, internal management data columns added during import        may be identified with appropriate flags.    -   Process As—this indicates how this column will be        represented/processed in the data lake. In a preferred        embodiment, all columns are imported and processed as String        data types (with any necessary data conversion performed        automatically)    -   Nullable—flag set to ‘true’ if the column is allowed to take a        null value in the source table, otherwise the flag is set to        ‘false’    -   DeltaView Prefix—This is used for Oracle Data Integrator feeds        only, and is used by the Re-sequencer and Data Cleanse process        to determine the name of the database journal view to be used as        input. The DeltaView Prefix refers to the prefix of the name of        the database view of the source system journal database, e.g.        For the CRM table called “ADRC”, the view name of the journal        database is “CRM_JE_ADRC”, hence the DeltaView Prefix is        “CRM_JE_”.    -   Validate As—this is the data type against which the column value        should be validated if data is processed in the data lake.

The specific metadata collected may vary depending on the type of sourcedatabase.

The schema metadata is stored in a metadata repository 310, for examplein CSV (comma-separated values) format (e.g. as a CSV file per sourcetable) or in any other suitable manner. The metadata repository may bestored in the data lake or separately.

The Schema Differentiator 304 identifies schema changes in the source102 for each table. If a schema change is identified the old schema willbe archived in an archive directory and the new schema will be kept forfurther processing. The schema differentiator also provides a signal tothe Sqoop Generator 306 and Data lake schema generator 308 to generatenew Sqoop scripts and corresponding HQL scripts.

In preferred embodiments, the schema evolution process may only act onschema changes which would potentially impact storage and processing ofthe data in the data lake. In a preferred embodiment, the followingschema changes are considered as potentially affecting the data lakedata representation:

-   -   Addition of a column to a table    -   Unique index change for table

The following changes are not considered to affect the data lake datarepresentation:

-   -   Deletion of column    -   Renaming of a column    -   Change in column length/size    -   Change in data type (as the data lake considers all columns to        be of type String)    -   Sequence change of columns

However, whether or not specific schema changes affect the data lakerepresentation and thus should be detected and handled depends on thespecific implementation of the data lake and the data representationused. Thus, in other embodiments, the set of schema changes detected andhandled may differ and changes such as column length or type change andsequence change may be handled in such embodiments.

As a particular example, in preferred embodiments, where a column isdeleted in the source table, the column is retained in the data lakerepresentation to allow historical data analysis. Nevertheless, futurerecords imported would not include the deleted column (and the importscripts may be modified accordingly). However, in other embodimentscolumns deleted in the source table could be deleted from the targetHive table as well.

Furthermore, different schema changes may require different types ofactions. For example:

-   -   Certain schema changes may result in changes in the target        schema and regeneration of import scripts (e.g. addition of a        column)    -   Certain schema changes may result in regeneration of import        scripts but not changes to the target schema (e.g. deletion of a        column in the above example), or vice versa    -   Certain schema changes may result in no changes to the target        schema or import scripts (e.g. change in column order)

Furthermore, the system may be configured to generate alerts for certaintypes of schema changes (even if no changes to target schema and/orscripts are needed).

The Sqoop Generator 306 reads metadata from the repository 310, andgenerates Sqoop scripts at run time for any source. Sqoop scripts aregenerated based on templates. Preferably, the system maintains multipleSqoop templates, each adapted for a specific type of source databasesystem. For example, different Sqoop templates may be providedrespectively for mySQL, Oracle and MS-SQL databases. Furthermore, foreach database system, separate templates are provided for initial loadand delta load processes (assuming the database in question supportsdelta load). If the schema differentiator 304 identifies schema changesaffecting the data import, then Sqoop generator 306 regenerates thescripts and replace the old scripts with the regenerated ones.

Imported data is stored in the data lake using a data schema appropriateto the storage technology used. The data lake schema generator 308generates the data lake schema for each table by reading the schemametadata from the metadata repository 310. It also evolves the data lakeschema in response to schema changes signaled by the SchemaDifferentiator. When modifying the existing schema, it maintains thehistory of the schema in an archive directory via an archival process312.

The Alert function 314 provides the facility to generate alerts relatingto the processing performed by the Metadata Generator/Schema Evolutionprocess 202. In one embodiment, the Alert function 314 generates thefollowing outputs:

-   -   success_tables—this is comma separated list of tables which have        successfully completed the process of metadata generation and        schema evolution    -   fail_tables—this is comma separated list of tables which have        failed in metadata generation or schema evolution    -   index_change_tables—comma separated list of tables for which a        unique index has been changed (such tables may require manual        intervention to change the schema before proceeding with data        import)    -   add_column_tables—comma separated list of tables for which        columns have been added

In preferred embodiments, the metadata generator and schema evolutionprocess provides an extensible architecture at all layers (modules),like the Metadata generator, Schema differentiator, Sqoop Generator,Data Lake Schema Generator and Alerts.

The operation of the Metadata Generation and Schema Evolution process isfurther illustrated in FIG. 4.

When the Metadata Generation and Schema Evolution process is triggered,the Metadata Generator 302 queries the RDBMS system at the data source102 to gather metadata for one or more specified tables. Collectedmetadata is compared with existing metadata for the same tables in themetadata repository 310 by Schema Differentiator 304.

If existing metadata is not found for a table, then it will be treatedas if the table is being imported into the data lake for the first timeand a signal is sent to the Sqoop Generator 306 and Data Lake SchemaGenerator 308 to generate Sqoop scripts and the data lake schema(including table information files, and initial load and delta load Hivequery language (HQL) scripts). Once required scripts have been generatedthey are stored in a local directory (specified in the configurationdata), and can then be used to generate the data lake environment forthe tables (i.e. the table structure, directory structure, andcollection of files making up the tables). These scripts can also beused to transfer tables between Hadoop clusters.

If existing metadata is found for a table, then the SchemaDifferentiator 304 identifies the difference between the new tableschema (as defined in the presently extracted metadata) and the oldtable schema (as defined by the metadata stored in the metadatarepository) and applies the changes to the data lake datarepresentation, regenerating scripts as needed. Metadata of each tableis archived in an archive directory on each run for debug purposes.Also, if schema differences are identified then the schema evolutionhistory is captured.

Generation and Operation of Import Scripts

The generation and operation of import scripts is illustrated in furtherdetail in FIGS. 5A and 5B.

FIG. 5A illustrates a set of metadata for a given source table from datasource 102 in the metadata repository 310, which is used to generatevarious scripts, such as table creation 502, Sqoop import 504 and Hiveimport 506. The scripts are executed to apply schema changes and importdata to the data lake 108.

FIG. 5B illustrates a more detailed example, in which a source table 104with table name “TJ30T” and a set of fields MANDT, STSMA, ESTAT, SPRAS,TXT04, TXT30, and LTEXT is being imported.

The Metadata Generator and Schema Evolution module 202 reads the tableschema metadata from the source and generates the following scripts(script generation is shown by the dashed lines in FIG. 5B):

-   -   A HQL script 510 comprising one or more data definition language        (DDL) statements for creating the Hive table 110 corresponding        to source table 104 in the Hadoop data lake    -   A Sqoop initial load script 512 for performing an initial load        of the full data of the source table    -   A Sqoop delta load script 516 for performing a subsequent delta        load from the source table (i.e. for loading a set of        differences since last import, e.g. in the form of inserted,        updated, or deleted records)    -   A Hive initial load script 514 for storing an initially loaded        full table data set into the Hive table    -   A Hive delta load script 518 for storing a table delta (i.e. a        set of differences since last import, e.g. in the form of        inserted, updated, or deleted records) into the Hive table

After the initial run of the Metadata Generator/Schema Evolution module202, the Hive create table script 510 is run to create the Hive table110. Then, the Sqoop initial load script 512 is executed to read thefull table contents of the table into landing area 208. Afterpre-processing (e.g. by the resequencing/cleansing process as describedelsewhere herein), the Hive initial load script 514 is executed to storethe data acquired by the Sqoop initial load script 512 into the Hivetable 110.

For subsequent imports of the table (e.g. this may be done periodically,for example once a day), the Sqoop delta load script 516 is executed toacquire the table delta since last import which is stored in landingarea 208. After pre-processing, the Hive delta load script 518 thenapplies the differences to the Hive table 110, e.g. by applying anynecessary insert, update or delete operations. However, in some cases(e.g. if tables need to be regenerated/recovered due to inconsistency orafter a failure), the initial load scripts could be run instead of thedelta load scripts to import the full table contents into the Hadoopdata lake.

The scripts thus together form part of an automated data import process,which is reconfigured dynamically in response to changes in the sourcedata schema, by modification/regeneration of the various scripts asneeded.

As previously mentioned, the system maintains templates for each RDBMSsource type (e.g. Oracle, Mysql, MS-sql etc.) to enable Sqoopgeneration. As a result, importing additional tables from existingsupported databases for which a template exists requires no developmentactivity. To support new source database systems, additional templatescan be added to the code to enable generation of initial and delta loadSqoop scripts.

Examples of scripts generated by the system are set out in the ScriptSamples below (see e.g. Samples 1-3 provided there). An example of aSqoop template is shown in Sample 6 of the Script Samples below.

If during a subsequent import the metadata generator/schema evolutionmodule 202 identifies changes to the source schema that affect how datais read from the source database, then the Sqoop scripts 512, 516 areregenerated as needed. Furthermore, if the changes in the sourcenecessitate changes to the Hive table structure, then the Hive scripts514, 518 are also regenerated as needed, and the Hive table structure isadapted as required (e.g. by executing an “ALTER TABLE” statement or thelike).

The following sections provide information on how different sourceschema changes may be handled.

Addition of a Column

As an example, a column may be added to the source table. Assume thetable initially has the structure illustrated in FIG. 5B:

Name Null Type MANDT NOT NULL VARCHAR2(9) STSMA NOT NULL VARCHAR2(24)ESTAT NOT NULL VARCHAR2(15) SPRAS NOT NULL VARCHAR2(3) TXT04 NOT NULLVARCHAR2(12) TXT30 NOT NULL VARCHAR2(90) LTEXT NOT NULL VARCHAR2(3)

Subsequently, the following column “COL1” is added to the table:

Name Null Type COL1 NOT NULL VARCHAR2(10)

The system then creates an additional column in the Hive table (see e.g.code sample 4 in the Script Samples below). Furthermore the Sqoop andHive scripts are regenerated to reference the new column (see e.g. codesample 5 in the Script Samples below).

Deletion of a Column

Where a column in the source table schema is deleted, the scripts 512,516, 514 and 518 are similarly regenerated to no longer reference thedeleted column. While the column could then be deleted in the Hivetable, in one embodiment, the column is retained but marked as no longerin use. This allows historical data to be retained and remain availablefor analysis/reporting, but future imported records will not contain thecolumn in question.

Unique Index Change for Table

When one or more new key columns are added, the new key columns aremoved to the left-most positions in the Hive schema, as this can be moreefficient for map-reduce code to process (e.g. when performing deltacalculations as described below), since such processing is typicallybased on processing primary keys, and hence only the first few columnsare frequently parsed and not the entire records. In some embodiments,this change may be performed manually though it could alternatively alsobe carried out automatically.

Other Changes

Preferred embodiments do not modify the Hive tables or import scriptsbased on changes in data type related information (e.g. changes of thedata type of a table column, changes in column lengths, etc.) as alldata has by default been converted and processed as character stringsduring import. However, if there was a requirement to retain data types,then the described approach could be changed to accommodate this andautomatically detect and handle such changes, e.g. by implementingappropriate type conversions.

Difference Calculator

The present embodiments allow changes in source tables to be captured intwo ways. Firstly, a change data capture solution can be implemented onthe source system to capture change data. This could be implementedwithin the source database environment, to identify changes made to datatables and export those changes to the Data Tap import tool. However, insome cases, the complexity of such a solution may not be justifiedand/or the underlying data storage system (e.g. RDBMS) may not providethe necessary functionality.

Data Tap therefore provides a difference calculator tool to avoid theneed for implementing such an expensive solution on the source system.

Some of the key features of the difference calculator include:

-   -   Scalable/Parallel Execution using Map Reduce Architecture    -   Automatically recognises the DML Type of Record    -   Provides framework to re-run on failure or re-commence from        failure point    -   Automatic Creation of Hive Metadata for newly created partitions    -   Ease of use which minimises development time

The difference calculator can be used provided that the source data canbe extracted in a suitable timeframe. It is therefore preferable to usethis method for low to medium-sized data sets depending on the dataavailability requirements.

Generally, the decision on whether to use the difference calculator or achange data capture solution can be made based on the specific datavolumes and performance requirements of a given application context. Asan example, benchmarks run for a particular implementation have shownthat to process 3 TB of data spread across approximately 600 tables willtake approximately 6 hours (4 hours to pull data from Source into thelake, 2 hours to run through the Difference Calculator & History CaptureProcess). In a preferred embodiment, delta processing is performed atsource if the table size exceeds 30 GB. This is not a hard limit, but isbased on the impact of storage size and processing time on the Hadoopplatform.

In one example, if performed at source in an Oracle databaseenvironment, then Oracle Golden Gate may be used to process the deltas,and Oracle's big data adapter may be used to stream these delta changesstraight to the Hadoop file system where the changes are stored in afile. The system periodically takes a cut of the file, and then HiveInsert is used to update the Hive tables in Hadoop. In this scenario,Sqoop scripts may not be needed to import data from the source.

On the other hand, if the difference calculator is used (e.g. for tablessmaller than 30 GB), then the whole table is copied periodically acrossto the Hadoop HDFS file system using a Sqoop script (e.g. script 512),and the difference calculator then runs on the copied table data.

In an embodiment, both Sqoop and Oracle's big data adapter have beenconfigured to output their files in character string format to enableeasier parsing. However, in alternative embodiments this could bechanged, so that the native formats are passed across in both Sqoop andOracle's big data adapter.

The architecture of the difference calculator is illustrated in FIG. 6A.

Data is read from a table in the data source into an initial landingarea 208 as previously described. Initial processing/cleansing isperformed and the pre-processed data is stored in staging area 212. Thedifference calculator then compares the table data to a previous versionof the table (e.g. a most recently imported version, a copy of which maybe maintained by the system) and identifies any differences. Theidentified differences are saved to landing area 218 and provided asinput to the history capture process 220 (see FIG. 2).

FIG. 6B illustrates the software architecture of the differencecalculator process. Table data is read into the staging area 212 (vialanding area and pre-processing if required as previously described)using a push or pull transfer model. The difference calculation isimplemented in a parallelised fashion using a map-reduce algorithm. Tosupport this, a “Path Builder” component 604 may be provided which isused to construct the directory path names for use by the map-reducecode implementing the Difference Calculator and incorporates the datasource and table names. Here, the mapper 606 reads the table informationand separates the primary key and uses this as the data key for themap-reduce algorithm. A source indicator is added identifying datasource 202, and a partition calculation is carried out. The reducer 608iterates over values to identify whether records are present in thelanding area and identifies the change type (typically corresponding tothe DML, data manipulation language, statement that caused the change).The change type is thus typically identified as one of Insert, Update orDelete. The change is stored e.g. with the record key, change type, andold/new values (if required).

Delta processing is performed on a row-by-row basis. The systemmaintains daily snapshots of the whole source tables (e.g. stored in theHadoop data lake). Newly imported data is compared to the most recentprevious snapshot of the table (corresponding to the time of the lastrun of the difference calculator) to produce a delta file for the table.

In one embodiment, the system maintains 15 days of old table snapshotson the Hadoop platform. This is one reason for the 30 GB limit employedin one embodiment, together with the time it takes to process thedifferences between two 30 GB tables. However, the specifics may varydepending on application context and available processing/storageresources.

FIG. 7 is a flow chart illustrating the difference calculation process.The process begins at step 702 after a table has been read into thestaging area. In step 704 an input path stream is built by the pathbuilder component (in the form of a string containing the directory pathname for use by the map-reduce code). In step 706, records in thestaging area are parsed and primary key and secondary keys are populatedin the mapper output (in an example, a time stamp added during import aspart of the management information is used as a secondary key, with thedifference calculator sorting the output by primary key and then by thesecondary key). In step 708 the system checks whether a given primarykey exists in both the current version of the Hive table in the datalake (i.e. as stored in the OPEN database) and the staging area. If yes,then the imported version of the record is compared to the cachedversion (preferably comparing each column value) and is marked as anupdate in step 710 if any differences are identified. If not, then step712 checks whether the primary key exists in the staging area only (andnot in the Hive table). If yes, then the record is a new record, and ismarked as an Insert in step 714. If not, then it follows that the recordexists in the Hive table but not the staging area, and is therefore adeleted record. The Record is marked as deleted in step 716.

Hive Insert is then used to insert the delta rows from the delta fileinto the Hive tables in Hadoop for any updates marked as “Insert”.Similarly, Hive Update commands are used for any changes marked as“Update” to update the values in the Hive table, and Hive Deletecommands are used to remove records marked as “Deleted”.

Note that these changes occur in the OPEN database. As describedelsewhere, the OPEN and CLOSED databases are re-created regularly (e.g.each day) by the History Capture process. Thus, rows which are deletedare no longer present in the OPEN database, but remain in the CLOSEDdatabase (with the additional time-stamp related columns updated toreflect the validity periods and reasons). There may be certaincircumstances in which certain tables are not permitted to have theirrows removed. In these cases the rows remain in the OPEN database butare marked as “Discarded” instead.

FIG. 8 illustrates an example of the delta calculation. Here, a numberof tables Table A (802) to Table N (804) are processed by the DeltaCalculator 216. In each case, a primary key column (or columncombination) is used as the basis for identifying the differencesbetween an old snapshot 806 (previously imported from the data source)and a new snapshot 808 (currently imported from the data source). Inthis example, column “coil” may, for example, serve as the primary key.The delta calculator identifies the difference between the old snapshot(with old column values) and the new snapshot (with new column values).Here, for Table A, the following differences are identified:

-   -   The record with col1=11 is no longer present in the new snapshot    -   The record with col1=12 has been modified in the new snapshot    -   The record with col1=15 is newly added in the new snapshot

Thus, entries are added to Table A Delta 810 for each identifieddifference, with a flag indicating the update type(UPDATE/DELETE/INSERT) and the new column values (for UPDATE and INSERTentries) or the old column values (for DELETE entries). Similar deltasare generated for the remaining tables (e.g. delta 812 for Table N).

The generated table deltas including flags and column values are thenused to update the corresponding Hive tables (e.g. via the previouslygenerated Hive delta import scripts).

As previously indicated, the delta calculation process is preferablyimplemented as a distributed map-reduce algorithm (e.g. running acrossthe Hadoop cluster), making it highly scalable and allowing deltas formultiple tables to be calculated in parallel. The process isconfigurable and metadata driven (using the metadata stored in themetadata repository 312).

History Capture

Generally, after the initial import from a new data source has occurred(via the initial load scripts) and the relevant structures have beencreated in the data lake for the imported data, subsequent updates areperformed incrementally (using the delta load scripts and differencecalculator as needed), to capture changes in the data sources and applythose changes to the data lake (see FIG. 5B). In some embodiments, suchupdates could occur on an ad hoc basis (e.g. in response to operatorcommand) or on a scheduled basis. In the latter case, the updateschedule could differ for each data source.

However, in a preferred embodiment, for efficiency and to ensure adegree of data consistency, a coordinated approach is adopted, in whichall data sources are updated on a periodic basis. In this approach,delta load is performed on a periodic basis, e.g. daily, from each ofthe imported data sources, and the OPEN and CLOSED databases are updatedaccordingly. This periodic update is coordinated by the History Captureprocess.

History Capture is a process which is run intermittently, preferably ona regular basis (e.g. daily, for example every midnight) to create thesnapshot of the current stable data in the data lake.

In an embodiment, the History Capture process is implemented as a Javamap-reduce program which is used to update the two main operationaldatabases, namely OPEN and CLOSED. The process uses the output fromdaily delta processing (e.g. from the Data Tap Difference Calculator asdescribed above, or from table deltas provided by the source databasese.g. via the Oracle Golden Gate/Oracle Data Integrator feed). It thendetermines which rows should be inserted, updated, or deleted, andcreates a new set of database files each day for both the OPEN andCLOSED databases. As part of this process every table row istime-stamped with five additional columns of management information,namely:

-   -   jrn_date—time-stamp from the source system database (for Oracle        Data Integrator feeds this is from the source system journal        database, for DataTap feeds this is when the Sqoop import script        is run to copy the source system database)    -   jrn_flag—indicator whether the record is an: INSERT, UPDATE, or        DELETE    -   tech_start_date—time-stamp when this row is valid from, i.e.        when History Capture has inserted or updated this new record.    -   tech_end_date—time-stamp when this row is valid until, i.e. when        History Capture has updated (overwritten), deleted, or discarded        this old record. In the OPEN database all rows are set to a        high-date of 31/12/9999.    -   tech_closure_flag—reason this old record has been removed:        UPDATE, DELETE, DISCARD.

In a preferred embodiment, neither of the actual databases (OPEN andCLOSED) are updated, rather the Java M/R will re-create a new version ofthe database files for both the OPEN and CLOSED tables, each with thefive time-stamp related columns updated to reflect validity periods ofthe rows.

The “tech_start_date” and “tech_end_date” columns effectively describethe dates and times between which a particular row is current. Thesedates are used to ensure the current version received from the sourcesystem is stored in the OPEN database holding the current view of thedata. When any updates/overwrites or deletes are detected as part of thehistory capture process, old rows are removed from the OPEN database andadded to the CLOSED database with the appropriate time stamp.

Thus, after the delta import and History Capture processes are complete,an updated OPEN database will hold a currently valid data set comprisingdata from the various imported data sources, while the CLOSED databasewill hold historical data.

By way of the described processes, changes made in the source databaseautomatically propagate through to the data lake. This applies both tochanges of data contained in a given table, as well as changes in thedata schema.

For example, if a column was added to a table in a data source, onlyrecords since the addition may have a value for that column in the datasource, with other records holding a “null” value for that column.Alternatively, values may have been added for the column forpre-existing records. In either case, the null or new values willpropagate to the OPEN database in the data lake (which will have beensuitably modified to include the new column). The latest version of thesource data tables is then available in the OPEN database, and anyprevious version is moved to the CLOSED database. The CLOSED databasewill retain all data lake history including what the tables looked likebefore the changes made on a particular date.

Note that in some cases source databases may already include historyinformation (e.g. by way of date information held in the source tables).Such application-specific history information is independent of thehistory information captured by the History Capture process and will betreated by the system (including Data Tap) like any other source data.Such information would thus be available to consumers in the data lakefrom the OPEN Database in the normal way.

The History Capture process responds to deletion, overwriting orupdating of any information in the source (regardless of whether theinformation corresponded to historical data in the source), by movingthe old version to the CLOSED database with timestamps appliedaccordingly.

Table Analyser

Referring back to FIG. 1, the Table Analyser tool 107 providesfunctionality for analysing the data contents of tables imported intothe data lake in order to identify relationships between tables.Typically, the relationships identified are of the nature of a primarykey to foreign key relationship, i.e. a relationship between a primarykey in one table and a corresponding foreign key in another table. Suchrelationships are commonly used to represent one-to-one and one-to-manyentity relationships in relational data schemas (with many-to-manyrelationships usually modelled using auxiliary mapping tables).

In the following examples, for simplicity and clarity, a candidate key(whether primary or foreign) is generally assumed to correspond to asingle column of a database table. However, a candidate key mayalternatively include multiple columns from a table (e.g. concatenatedto provide the key value). More generally, a key could correspond to anyvalue derived in any suitable fashion from one or more columns of atable. A candidate relationship is defined between multiple candidatekeys (typically but not necessarily from different tables), wherecandidate keys may perform a primary key or foreign key function in arespective table. The Table Analyser evaluates candidate relationshipsin a given set of tables to quantify a strength of the candidaterelationships (indicating a likelihood that these correspond to actualrelationships), and identifies possible relationships based on thatevaluation.

The process performed by the Table Analyser to identify relationships issummarised in overview in FIG. 9. The Table Analyser operates based on aset of input files 904 including the source tables 901 as well as anyconfiguration data.

The set of tables 901 for which relationships are to be identified may,for example, be specified by a user when invoking the Table Analyser(e.g. via a user interface), as parameters in a scripted invocation, ina configuration file or in any other suitable way. The tables are storedin the data lake 108 as described above.

A data mapper module 910 (which comprise multiple mappers executing inparallel) reads the table data for all identified tables. A given tableconsists of a number of rows (corresponding to records of the table) anda number of columns (corresponding to individual data fields withinthose records). Each data field in a record may contain a data value (inaccordance with some data format, e.g. string, integer, data etc.) ormay (if the table definition allows) be null, indicating that no valueis stored there.

In step 912, a map table is generated in which all the data values fromthe input tables are mapped to their source column locations. Thegenerated map table thus includes a set of entries where each entryspecifies a particular value appearing in one of the source tablestogether with information identifying the source table and column fromwhich that value was read.

In step 914, aggregation is performed to aggregate map table entries forthe same value from the same source column. A count is added to eachaggregated entry indicating the number of occurrences of the given valuein the given column. The table is then sorted on the data values.

In step 916, the sorted information is partitioned for parallelprocessing. As a result, the aggregated map entries generated in step914 are split across a number of data files 902 for subsequentprocessing.

A Data Read Reducer module 920 then operates in parallel on the datafiles 902 to determine statistical information relating to the columnsof the input tables. Firstly, in step 922, the number of distinct valuesper column is identified. In determining this, repeated occurrences ofthe same data value in a column (i.e. where the data value appears inthat column across multiple rows) are counted as a single distinctvalue. In step 924, the process identifies pairs of columns that havedata values in common (i.e. where a value appearing in one column alsoappears somewhere in the other column of the pair). Such data values arereferred to herein as intersecting data values for the column pair. Instep 926, the number of distinct intersecting values for each columnpair are determined (as above, here “distinct” means that multipleoccurrences of the same shared value are counted as a single distinctintersecting value).

The results of parallel execution of the Data Read Reduce reducercomponent 920 are combined into a single analysis file 903. The analysisfile thus now contains statistical information concerning the datavalues in the source columns as well as intersecting values inrespective pairs of columns.

Based on this data, the consolidated analysis module 930 computes foreach source column the probability that the column is a key column forits table in step 932. A key column is generally taken to be a columnthat identifies a particular record within a table. Thus, when servingas a primary key, such a column generally includes a unique value foreach record, uniquely identifying that record. However, it should benoted that the data sets may be imperfect and/or include duplication soa column may not need to have strictly unique values to be considered apotential key column. The present approach thus considers both primarykeys in the strict sense (where each record includes a distinctidentifying key value) and columns with large proportion of distinctvalues as candidate keys.

In step 934, the process calculates for each possible pairing of sourcecolumns, the probability that the pair of columns exhibits a foreign keyrelationship. For example, this may indicate that a particular column inone table, which may be a primary key for that table (e.g. a customeridentifier in a “customers” table), may be related to a column inanother table (e.g. where an “orders” table includes a customeridentifier as a foreign key for each order).

The probability is determined based on the respective probabilities thatthe columns are keys for their respective tables (as determined in step932) and on the degree of overlap or intersection between the columns(as set out in more detail below) and is referred to herein as the“combined probability” for the column pair. The combined probability fora column pair can be taken as expressing a level of confidence thatthere is a relationship between the columns, or alternatively may beunderstood as an indication of the strength of the relationship betweenthe columns.

In step 936, an output file 906 is generated including information onidentified table relationships. The analysis component may rankidentified relationships based on strength and could additionallyclassify column pairs into different classes of relationships based onthe probability or strength of relationship (e.g. strongrelationship/weak relationship/no relationship likely to exist) andincludes the classification/ranking information in the output file.

The identified relationships may, for example, serve as the basis forjoin queries performed during data analysis tasks (e.g. by analyticsmodule 112) as described in more detail later.

In this example, the algorithm is divided (at least conceptually) intodistinct components or modules, including the data mapper component 910;data read reducer component 920 and consolidated analysis component 930.However, the algorithm may be structured in any appropriate manner.Similarly the division into “steps” is for illustrative purposes and inpractice, implementations may structure the processing differently andthe order of steps may be varied.

In preferred embodiments either or both of the mapper and reducercomponents may be parallelized (with multiple mappers and reducersoperating in parallel in the Hadoop cluster), preferably implemented asa map-reduce algorithm using the Hadoop map-reduce architecture, whilstthe analysis component 230 operates as a single process. However, itshould be noted that the fundamental algorithm may be implemented in anyappropriate manner (including in a serialized form or in alternativeparallel implementations).

Processing Example

The analysis process set out above will now be described in more detailusing a concrete example. The data being processed in this example isillustrated in FIGS. 10-14A for different processing stages.

FIG. 10 illustrates step 912 of FIG. 9, in which the data values aremapped to their column locations, identifying the source table andcolumn for each data value.

In this example, two source tables 1002 (“Table 1”) and 1004 (“Table 2”)are being processed, each including three rows (numbered 1-3) and threecolumns (labelled A-C). Note that the number of rows and columns areexemplary only and the tables need not have the same number of rows orcolumns. Also, the column labels A-C are arbitrary labels used forillustrative purposes (in practice each table will comprise a respectiveset of named columns). As described previously, each table may bepartitioned across multiple files in the HDFS. Thus, in this initialstep of the mapping phase, the files that make up the source tables maybe processed in parallel (in this implementation using Java Map-Reduceand/or Spark).

For each selected table, the individual data values from every column inevery row are mapped to their table and column location. Special valuessuch as null and other predefined exceptional values are processed asexceptions and are not treated as ordinary data values in thecomputations described below.

Preferably, the exceptions are defined in a configuration file whichspecifies values to be ignored from the processing to improveperformance and accuracy. In addition to ignoring specific values,particular columns may be ignored (e.g. based on detectedcharacteristics of the column). For example, the tool may be configuredto ignore columns that only contain a single value, as this adds nothingto the accuracy and improves performance. Another example is to ignorethe management data columns that are added as part of the Data Tapingestion process, as these were not part of the source data, and mightskew the results. Additionally, for certain data sources, some columnsare found to contain lots of zeros as text strings; hence in suchcircumstances the tool could be configured to ignore any column valuecontaining three or more zeros. The exceptions may be configured in anysuitable fashion, e.g. by specifying particular values to be excluded orby providing expressions that can be evaluated (or other executablecode) to determine whether a given value or column matches an exception.

Additionally certain summary data is captured, such as the amount ofignored data (e.g. in terms of the number of ignored values and/or thenumber of ignored

bytes of data), for each column and for each table.

The mappings are recorded in map table 1006. The main section 1008 ofthe map table includes entries for each data value appearing in one ofthe source tables, with the data value specified in the “Value” column.The table location from which the value was read is stored in thelocation (“Loc”) column. Here, the location is specified by a locationreference that indicates both the source table (Table 1 “T1” or Table 2“T2”) and the column within that table (A, B or C) from which the datavalue was read. Thus, “T1A” indicates column A in Table 1, “T2C”indicates column C in Table 2, and so on. In practice, any appropriateencoding or referencing may be used to identify the source table andcolumn of each value.

At this stage, the entries appear in the table in the order they wereprocessed (here row-by-row and left-to-right in table 1, followed by thesame for table 2), with an entry added to the map table as each datavalue is read.

Additionally, accumulated statistics are stored in sections 1010 and1012 of the output.

Section 1010 includes column statistics, specifying for each column(identified by its column code):

-   -   The number of non-null values appearing in that column (repeated        values are counted separately; in other words this is the number        of records having any non-null value, not a count of distinct        values). Values other than “null” defined as exceptions to be        ignored are preferably also excluded from this count.    -   The number of null values appearing in that column (i.e. the        number of records for which the corresponding field has a “null”        or unspecified value)    -   The number of records whose value in the relevant column matches        an exception and is being ignored in the processing.

Section 1012 includes table statistics for each table, specifying thetable identifier, total number of rows processed for each table and thenumber of ignored rows.

In addition to the data indicated above, other accumulatedcolumn-specific or table-specific statistics or summary information maybe collected in sections 1010 and 1012.

Here, the output for all sections 1008, 1010 and 1012 in depicted ascontained within a single map table 1006 (with entries differentiated bya “value”, “col” or “table” indicator in the “Type” column, indicatingthe different sections for value data, column statistics and tablestatistics respectively). However, in alternative embodiments, thedifferent sections may be stored in different data structures. Forexample, value data 1008 may be stored in the main map table, withstatistics 1010/1012 stored in one or more separate data structures.Furthermore, the output 1006 may be stored in a single file or may besplit across multiple files.

Whilst a single mapper output is shown in practice the mapping step istypically performed in parallel by multiple mappers operating onrespective tables or (for partitioned tables) respective tablepartitions. Each mapper then produces a respective map table 1006 basedon the subset of data processed by that mapper.

FIG. 11 illustrates step 914 of FIG. 9, in which the map table entriesare aggregated, counted and sorted.

In this step each of the map table files produced in the previous stepare again processed, preferably in parallel (in this implementationusing Java Map-Reduce and/or Spark). The individual data values in eachfile are counted by location and sorted. The column and table summarydata is not modified in this step but is simply passed through to theseaggregated files.

In FIG. 11, table 1006 corresponds to the map table output by theprevious step, and table 1100 shows the processed map table. It can beseen that the entries from table 1006 have been aggregated on the valueand location identifier fields, so that the aggregated table 1100 nowincludes a single entry for each distinct combination of data value andsource column, with a “count” field added indicating the number ofoccurrences of that value in that specific column. For example, row “1”in table 1100 indicates that the value “0” occurs twice in Table 1Column A (“T1A”). The table has been sorted by data value (i.e. thecontents of the “Value” field).

FIG. 12 illustrates step 916 of FIG. 9, in which the output from theprevious step is partitioned into multiple data sets for parallelprocessing.

The files are divided so that no value key spans more than one file. Ina preferred implementation, the number of files output is about 10% ofthe number of files input at the start of the phase, although this isconfigurable.

In the example, aggregate table 1100 (representing the output from theprevious processing stage) is split into two files 1202 and 1204. Thefile 1202 includes entries 1-6 from table 1100, whilst file 1204includes entries 7-14. Entries for each particular data value (asrecorded in the “Value” column) are kept together in a single file ofthe output so that they will be processed by the same process in thenext stage. The summary data is divided across the output files based onthe Java Map-Reduce partitions (here only the final row of the summarydata, row 22, is shown for clarity).

FIG. 13 illustrates steps 922, 924 and 926 of FIG. 9 to calculaterelevant statistics for columns and column pairs.

In this step the files (in the example files 1202, 1204) output by theprevious step are preferably processed in parallel (in thisimplementation using Java Map-Reduce and/or Spark). The results are thencombined into analysis file 1300, where necessary aggregating partialresults calculated for individual files.

Firstly, the number of distinct values appearing in each column isdetermined by counting the number of entries for each specific tablecolumn in each input file 1202, 1204. In this example, column “T1C” hasone entry in File 1202 and two entries in file 1204. Since each entrycorresponds to a distinct data value, this means that column T1C hasthree distinct values in total. The generated analysis file 1300includes an entry for each column in the original source tables (seeentries 1302 in the analysis file 1300), each entry including the columnidentifier and a distinct value count (“Distinct” field).

Secondly, the number of distinct intersecting values are computed foreach possible pairing of columns having at least one common value.Distinct intersecting values are distinct values that appear in bothcolumns of a given pair (i.e. only unique value matches between columnsare counted as distinct intersects). Hence in the present exampletables, “T1A” (table 1 column A) has only one distinct intersectingvalue with “T1C” (table 1 column C), namely value “0”, whereas “T1B”(table 1 column B) has three distinct intersecting values with “T2B”(table 2 column B), namely values “1”, “3”, and “5”.

In one embodiment, these values can be calculated by cycling through thedata values in the input files 1202, 1204, and for each data valuelisted in the “Value” column, determining the possible columncombinations that share that value and incrementing a counter for eachcolumn combination. For example, file 1202 shows that value “1” appearsin four columns (T1A, T1B, T2A and T2B) and there are six unique columnpairings of those four columns (where ordering is not relevant i.e.<Column 1, Column 2> is the same pair as <Column 2, Column 1> and acolumn cannot be paired with itself). The six possible pairs which havevalue “1” in common are therefore <T1A, T1B>, <T1A, T2A>, <T1A, T2B>,<T1B, T2A>, <T1B, T2B>, <T2A, T2B>. Thus a counter for each of thosetable pairs is incremented (prior to this step counters are initialisedto zero for each possible column combination). Counters from individualprocessing passes for respective files 1202, 1204 are then aggregated(summed) when generating final output 1300. Here, file 1202 shows onedistinct value for column pair <T1B, T2B> (value “1”) whilst file 1204shows two (“3” and “5”), and hence the total number of distinctintersecting values for that column pair is determined as three.

Preferably, only unique combinations of pairs of columns with distinctintersecting data values are reported in the output. Column pairs withno intersecting values are preferably not included in the output. Theoutput is added as a set of entries 1304 in the output file 1300, withone row for each column pair having at least one intersecting value (seerows 7-15), each entry identifying the column pair and the number ofdistinct intersecting values.

The column and table summary data 1306 continues to be passed through tothe single sorted output file for later analysis in the final phase(here only row 22 is again shown for clarity). Once again, the sections1302, 1304 and 1306 are shown as sections of a single file butalternatively these could be stored in separate files/data structures.

FIG. 14A illustrates the final analysis phase (steps 932, 934 and 936 ofFIG. 9).

In this final phase the single analysis file 1300 produced in theprevious step is processed.

The probability for any given column being a key is calculated and isreferred to herein as the Key Probability (KP). In a preferredembodiment, this is computed as the number of distinct valid values(values which are not null and which are not ignored for other reasonse.g. based on defined exceptions) divided by the total number ofnon-null, valid values in the column (or alternatively by the totalnumber of rows in the column, i.e. including null or invalid entries).Thus the Key Probability gives an indication of the distinctness orspread of values in the column; columns with many repeated values willhave a low KP value whilst columns with little repetition will have ahigh KP value. In the case of a true primary key field each value in thecolumn will be distinct, so that the number of distinct values willequal the total number of values and the KP will therefore equal 1.

After computing KPs for each column, each possible column pair will havetwo Key Probabilities associated with it (one for each column). Theseare referred to herein as the Left Key Probability (LKP) for the firstcolumn of the pair, and Right Key Probability (RKP) for the secondcolumn of the pair. A Maximum Key Probability (MKP) is identified as thegreater of the LKP and RKP for the pair. The MKP thus provides anindication of the likelihood that one of the columns of the pair may actas a primary key column for its table.

For each column pair, respective ratios of the number of distinctintersecting data values of the column pair to the total number ofdistinct values within each column are also calculated. These arereferred to herein as the Left Intersect Probability or LIP (number ofdistinct intersecting values divided by total number of distinct valuesin the first column of the pair), and Right Intersect Probability or RIP(number of distinct intersecting values divided by total number ofdistinct values in the second column of the pair). A Maximum IntersectProbability (MIP) is then determined as the greater of the LIP and RIP.The MIP provides an indication of the degree of overlap in theinformation contained in the respective columns of the column pair,where high overlap might be taken as representative of a relationshipbetween those columns (e.g. a primary-foreign key relationship). In theabove computations, null values and other defined exceptions (invalidvalues) are preferably not counted in any of the counts of “distinct”values.

A Combined Probability (CP) is then computed based on the MKP and MIP.In one example, the CP is computed as a product of both the MKP and MIPand represents the combined probability of a join-type relationshipexisting between the columns (or alternatively the CP may be taken asindicative of a relationship strength).

In one embodiment, the calculation of the CP is carried out only if theMKP and/or MIP values meet predetermined criteria. The criteria may beexpressed in terms of minimum thresholds for MKP and/or MIP. Columnpairs below the threshold(s) are marked as unlikely to exhibit arelationship and are not further considered (in an example, pairs havingMKP and MIP values below 0.1 are marked as unlikely.) The thresholdsand/or other criteria applied are preferably specified in configurationdata.

Note that the specific calculations are provided by way of example, andalternative statistics may be used or the calculations of the variousindicators may be varied depending on requirements, the nature of thedata, and other factors. For example, the CP could be computed as a(possibly weighted) sum of the MKP and MIP, or the maximum or minimum ofthe MKP and MIP may be used as the CP. Similarly, the LKP and RKP onethe one hand, and the LIP and RIP on the other hand, may each becombined in some other way (e.g. as weighted sums) to derive the MKP/MIPvalues (instead of selecting the maximum of the left and right values).

The statistics computed are summarised below, with reference to FIG. 14Bwhich shows a Venn diagram illustrating the overlap between columnvalues for two columns A and B. Here, “a” represents the set of distinctvalid (non-null and not excluded) values that appear in column A, whilst“b” represents the set of distinct valid (non-null and not excluded)values of column B. Intersection “c” represents the set of uniqueintersecting values; that is, distinct valid values that are common to(appear in both) column A and column B. The computed statistics are asfollows:

-   -   Key Probability (KP) is the number of distinct valid values        divided by the total number of valid values/records for a given        column.    -   Left Key Probability (LKP) is the probability of Column A being        a key (i.e. the KP value computed for Column A).    -   Right Key Probability (RKP) is the probability of Column B being        a key (i.e. the KP value computed for Column B).    -   Maximum Key Probability (MKP) is the greater of LKP and RKP.    -   Left Intersect Probability (LIP) is the ratio of distinct valid        intersected values (c), to the total number of distinct valid        values in column A (i.e. in the set a).    -   Right Intersect Probability (RIP) is the ratio of distinct        intersected valid values (c), to the total number of distinct        valid values in column B (i.e. in the set b).    -   A Maximum Intersect Probability (MIP) is the greater of LIP and        RIP.    -   The Combined Probability (CP) is a product of MKP and MIP.

The column pairs are then ranked based on the CP, which takes a valuebetween 0 (low relationship probability) to 1 (high relationshipprobability), to identify column pairs more or less likely to exhibitrelationships. A rank value indicating the ranking for a column paircompared to other analysed column pairs may be computed and stored foreach column pair (e.g. as a simple number sequence ascending ordescending in rank order).

Note that, as mentioned above, CP may be calculated only for qualifyingcolumn pairs meeting certain criteria, with others marked as unlikelyrelationship candidates, with subsequent processing (e.g. ranking) onlyperformed for qualifying column pairs.

Furthermore, for each distinct pair of tables (here there are only twoinput tables so there is a single pair), an indicator of the likelihoodof a relationship existing between the tables may be determined. In apreferred embodiment, this is based on the best/strongest columnrelationship (highest CP value) between the columns of the tables.

The computed data is added to the output file 1400. In this example, theoutput file includes:

-   -   Entries for each table with the table identifiers (rows 1-2)    -   Entries for each table column (rows 3-8) each associated with        the column identifier, and the Key Probability (KP) calculated        for the column    -   An entry (row 9) may optionally be provided for one or more (or        each) table pair(s) (here the only pair is T1, T2) giving the        key and intersect probabilities and a rank value indicating the        strength of relationship, based on the strongest column        relationship between the tables. In one embodiment, this        information is not included explicitly in the output at this        stage, but related table pairs are inferred from the strongest        column relationships between tables.    -   Entries (rows 10-13) for each column pair where a relationship        may exist (e.g. where a CP was calculated), with the calculated        probability values and calculated rank value. In preferred        embodiments, all the intermediate calculated metrics (LKP, RKP,        MKP, LIP RIP, MIP and CP) are stored (though alternatively only        some of the data may be retained)    -   Entries (rows 14-18) for each column pair determined unlikely to        exhibit a relationship (e.g. for which no CP was calculated due        to low MKP and/or KIP values), optionally with the other        calculated metrics as above    -   The summary data carried through from earlier processing (only        the final row is shown for clarity)

Each possible column pair essentially defines a candidate relationship,with the various computed metrics (especially the CP value) indicating arelationship strength of the candidate relationship (e.g. the higher theCP value, the stronger is the potential relationship between thecolumns). The final output file thus identifies the most likelycandidates for relationships between columns (including statistical andranking information to allow further evaluation of the relationships).

In the example depicted in FIGS. 10-14, the Table Analyser operates ontwo input tables, but in practice it may operate on any number of tables(within processing capacity constraints) to identify columnrelationships between any pairs of columns across the input tables. Thesize and number of input and output files are also purely exemplary. Thedata volume processed and degree of parallelization may be varieddepending on requirements and available processing resources.

The approach described above is capable of identifying relationshipsbetween any two columns in the input table set, including betweendifferent columns of the same table (and thus in principle the algorithmcould be run on a single input table). Such relationships may be useful,e.g., in database optimisation.

However, alternatively the Table Analyser could be constrained toidentify relationships only between columns from different tables (i.e.a candidate relationship would be defined by a column pair comprisingone column from one table and a second column from a second, differenttable). Such relationships correspond to the primary-key to foreign-keyrelationships frequently employed in relational database models to joindifferent tables when performing queries. In that case, columncombinations from the same table may be disregarded from the set ofcandidate relationships considered which may reduce the processingburden.

The described algorithm relies on comparison of data values betweencolumns of tables which may have originated from different data sources(and hence have used different data formats or representations forsimilar data). In a preferred embodiment, the Data Tap tool 106standardises data formats during import into the data lake. This mayinvolve converting all data to a single data type (typically String),preferably using consistent representations for source data types (e.g.a consistent string representation of Time/Date values) regardless ofsource representation. This approach can improve the ability of theTable Analyser to correctly identify matching data. However,alternatively (or additionally), data conversion or formatting may alsobe performed by the Table Analyser (e.g. during the initialreading/mapping step 912) to ensure data values are in a consistent datatype and format allowing effective comparison.

The output of the Table Analyser (as represented by output table 1400 inFIG. 14A) can be used in subsequent analysis of data in the tables. Forexample, data from disparate sources may be automatically combined andfurther processed/analysed. In one particular application, the outputdata of the Table Analyser may be used in the creation of queries on thedata imported into the data lake 108 (see FIG. 1). A Query Builder tool113 is provided to assist in the creation of such queries and will bedescribed in more detail below.

Extensions for Composite Keys and Partial Matching

In the above examples, relationships are defined between individualcolumns of respective tables. This may be extended to allow forcomposite keys as follows.

FIG. 14C illustrates example tables where multiple fields (columns) areneeded to define a unique key capable of identifying individual recordsof the table. Here, in Table 1, fields ID1 and ID2 are both needed touniquely identify a row, while in Table 2, fields ID3, ID4, and ID5 areall needed to uniquely identify a row. Where combinations of fieldsuniquely identify records the column combination is referred to as acomposite key.

Where each field of a composite key is a key in its own right, such acomposite key is also referred to as a compound key. An example is shownin FIG. 14D, where columns ID1, ID2, and ID3 are all needed to uniquelyidentify a row in Table 4 (thus acting as a compound primary key forthat table), but each column also acts as foreign key with regard toanother table (see relationships labelled Rel1, Rel2, Rel3). FIG. 14Eshows a further example, where ID5 and ID6 are both needed to uniquelyidentify a row in Table 5 and are related by relationships Rel5 and Rel6to corresponding columns of Table 6.

Applying the previously described algorithm to the example of FIG. 14D,the algorithm would identify fields ID1, ID2, and ID3 as strong primarykey candidates in Tables 1, 2, and 3, and that they have a high ratio ofdistinct data intersects with fields ID1, ID2, and ID3 in Table 4. Hencethe algorithm will correctly identify relationships Rel1, Rel2, andRel3.

In the Example of FIG. 14E, the above algorithm would identify thefields ID5 and ID6 as weak primary key candidates in Tables 5 and 6. Todeal with this, the algorithm may be extended to concatenate prospectivecompound key fields within a table (e.g. Table 5) that can be comparedwith prospective field(s) within another table (here Table 6). Inprinciple, for an exhaustive search, each permutation would need to beassessed, so to improve performance the algorithm preferably eliminatesunlikely compound key candidates from the concatenation process.

Compound key candidate reduction is illustrated in FIG. 14F.

Compound key detection is based on concatenation of prospective fieldsin order to check for a data intersection. In order to improveefficiency and performance, unlikely compound key pairs are preferablyignored prior to concatenation.

In this example, a candidate key field is analysed with 100 rowscontaining 85 distinct values within the candidate key field. There are80 occurrences where a distinct value appears once (i.e. it is unique).There are also 5 occurrences where a distinct value appears 4 times. Inthis example, column concatenation would preferably only be performedwith other columns containing four or more distinct values, as theywould need at least four distinct values in another field to make acomposite key based on the fields unique. Hence all other columns notmeeting this requirement would be ignored.

After eliminating unsuitable fields, the remaining field pairs areconcatenated for each permutation and data intersections compared withfields (or field combinations, also concatenated in an analogousfashion) in the other tables. An example of concatenation of fields ID5and ID6 into a composite key is shown in FIG. 14G.

The remainder of the algorithm then proceeds as described before,enabling a Combined Probability (CP) to be calculated for compoundcolumn groups, and hence allowing relationships Rel5/Rel6 to beidentified in the FIG. 14E example. In this example a composite key oftwo columns is analysed; this may in principle be extended to compositekeys of any number of columns, subject to practical limits oncomputational resources including execution time.

As a further extension, the algorithm (for both single-column keys andcomposite keys) may be extended to cater for partially matching fields,as illustrated in FIG. 14H. In this example the data intersection checkis enhanced to check for a subset of data in one field being containedwithin another.

Thus, in this case, instead of considering the full content of a keycolumn as a candidate key for a relationship, the candidate key isformed from truncated versions of the field values. More generally thiscan be extended to allow a candidate key for a table to be derived fromone or more fields of the table in any appropriate way, including bystring manipulation (e.g. truncation, capitalisation and the like) or bymathematical manipulation (e.g. rounding or scaling of values). Theappropriate manipulation may be selected automatically (e.g. to truncatestrings in one field to the same length as the maximum length of anotherpotential key field) and/or may be user-configured. This allowsrelationships to be identified between columns having similar data, evenif the data is not encoded in the same way in the columns.

Cumulative Relationship Learning

The Table Analyzer may be run repeatedly on a set of source tables (oreven on all tables in the data lake). In that case the Table Analyzer ispreferably configurable not to reanalyze relationships that have alreadybeen analyzed on a previous run but rather to search only for newrelationships. For example, if columns have been added to one or moretables, or if entire tables have been added, the Table Analyzer mayconsider only candidate relationships involving the new columns (e.g.relationships between added columns/tables only or between addedcolumns/tables and previously existing columns/tables). In this way, acumulative view of potential data relationships is built up without theneed to fully analyze all possible column combinations.

Metadata Manager Tool

Referring back to FIG. 1, the Metadata Manager tool 109 comprises a setof user interfaces and workflows allowing users to enter, edit andreview metadata in order to document the data held in the data lake 108,for example, defining the nature of particular tables/table columns andspecifying relationships between columns.

In a preferred embodiment, the metadata managed by the Metadata Managerprincipally serves a documentation purpose. This documentation metadatashould be distinguished from configuration metadata of the sourcedatabases, e.g. schema metadata read by the Data Tap tool from sourcedatabases 102 when importing data into the data lake 108 which definesthe structure of the data in the source database. Nevertheless, inprinciple the Metadata Manager could operate on any form of metadatarelating to data stored in the data lake, including source schemametadata and/or other configuration metadata (e.g. for configuringsecondary systems).

A high level overview of the metadata management workflow is illustratedin FIG. 15.

The process begins with a set of objects for which metadata is to becollected, referred to as the documentation queue 1500. “Objects” arecontainers for metadata relating to database entities associated withthe data imported into the data lake. The entities for which metadatamay be collected and which are represented as metadata objects in theMetadata Manager include both structural/functional database entities aswell as other forms of information that may be held in or associatedwith the source databases or the data lake. Examples of data entitiesand corresponding metadata objects may include:

-   -   Source databases    -   Tables    -   Views    -   Table columns    -   Relationships between tables/table columns    -   Queries    -   Reports    -   Business Rules

Thus, a metadata object could provide information defining the purposeand organization of a database table, the meaning of a table column, thefunctionality of a query, a description of a report etc. The nature ofthe metadata typically varies between objects. Purely by way of example,a “Report” metadata object providing a description of a report couldinclude metadata items such as Owner, Purpose, Validity Period,Description, etc. Business Rules can be plain text definitions and/orcan include logic, and could also be used to store a set of definitionsfor business terms (e.g. a Customer, a Household, a Sale).

Note that this list is purely given by way of example, and a givenimplementation may not use all of the above and/or may use other objecttypes.

The Metadata Manager tool is flexible and preferably allows users oroperators to create other types of object, assign selected metadataitems to the object, and then determine which roles can edit and whichroles can approve those objects/items. Metadata objects may also be usedto document the configuration of the system itself—as one example thesource connection settings for the Data Tap tool could be added asobjects to the Metadata Manager tool, with metadata such a textdescription and owner, for documentation and approval in the normal way.

In one example, the Data Tap tool may automatically create entries forimported data objects in the documentation queue 1500 directly whenperforming the import. Alternatively, the imported objects such astables and columns may be recorded in a separate data inventory, withthe Metadata Manager tool creating the documentation queue from thatinventory. Initially, objects in the documentation queue are marked witha status indicator indicating that they are in the process of “beingdocumented”.

A document definition process 1502 is then used to collect and recordmetadata for the objects in the documentation queue 1500. Recording ofmetadata occurs mainly via user interaction using a documentationinterface. However, some metadata may be automatically generated, eitherduring import or subsequently.

The recorded metadata for the object forms a “definition” of thatobject. Objects for which a definition (i.e. one or more items ofmetadata) has been recorded have their status indicator updated to markthem as “documented”. These objects are placed in an approval queue1504.

The object definitions in the approval queue are then subject to anapproval process, where a user (typically a user other than the userhaving created the original definition) reviews the recorded metadataand either approves the definition (step 1506) or raises a dispute (step1510). During this stage the status indicator is set to “beingapproved”. Once approval for an object definition is received, thestatus indicator is changed to “completed” and these object definitionsare added to a completed set of definitions 1508.

If the reviewing user disagrees with the definition or considers that itcontains errors, the dispute process is followed. Disputed objectdefinitions are added to a dispute queue 1512 with a status indicatorset to “disputed”. The definition is then reviewed (e.g. by a thirduser); if the reviewing user rejects the dispute (step 1514) the objectis returned to the approval queue 1504 and the status indicator reset to“being approved”. If the reviewing user agrees with the dispute (e.g.the user considers that there are errors in the recorded metadata), theobject is returned to the documentation queue 1500 and its status isreset to “being documented” (step 1516).

The documentation queue 1500, approval queue 1504, dispute queue 1512and completed set 1508 are presented here as logical entities and may beimplemented via any suitable data structures. In one example a metadatadatabase storing entries identifying the objects may be provided. Eachentry in the database may reference the relevant structures in the datalake (e.g. tables, columns, columns involved in relationships) or otherentities (e.g. stored queries) and may be associated with a collectionof metadata for the object and a status indicator indicating thedocumentation status. The queues may be dynamically determined by simplyretrieving entries with a particular status. Alternatively the queuesmay be represented as queue/list data structures referencing the objectdefinition database entries. Additional data may be recorded, such asdate/time stamps indicating when various actions were completed(documenting, approving, disputing etc.) and specifying a useridentifier for a user completing the action.

The possible status values for an object are summarized in Table 1below:

TABLE 1 Status Description Being The initial status. Basic informationabout the object has Documented been loaded into the systemautomatically. All of the additional information required is due to beentered or in process of being entered. Documented All of the required(mandatory) information has been entered. Additional non-requiredinformation can still be entered or the object definition can be passedfor approval. Being The object definition has now been passed forapproval and Approved therefore is read-only. All of the relevantusers/teams need to approve this object definition before it isconsidered complete. Complete All of the required users/teams haveapproved this. Information is considered accurate and the objectdefinition can be used (for example with the Query Builder). DisputedThis object definition is on hold until the dispute is resolved.

Objects in the various queues may further be assigned to particularusers, thereby forming (logical) user-specific work queues. The documentdefinition, approval and dispute processes are supported by a collectionof user interfaces allowing users to enter and review metadata andrecord problems or concerns. Additionally, a workflow interface isprovided to allow users to view objects allocated to them for definition(1502), approval (1506/1510) or dispute resolution (1514/1516), selectobjects to work on, and trigger the respective processes.

FIG. 16 provides an alternative representation of the above process.

Initially, at step 1600, data objects are ingested into the data lake bythe Data Tap tool. Independently (e.g. before or after data import), at1602, the metadata collection strategy is defined, specifying forexample, for each type of object:

-   -   What metadata should be collected    -   Which metadata items are mandatory    -   Which users should document the object    -   Which users are required to approve the object definition

At 1604, the system puts incomplete objects into the Documentationqueue. At 1606, object metadata is open for input for those individualsin a Documentation Role. These roles are specific to an individualmetadata item. At 1608, once all mandatory metadata has been documented,the system puts the documented object into the Approval queue and locksthe object for edit.

At 1610, metadata is open for approval for those individuals in anApproval Role. These roles are again specific to an individual metadataitem. At 1612, once all Approvers have approved all metadata definitionsthe object transitions to the “complete” status (1614), meaning that theobject has now been approved for use.

At 1616, if an Approver disputes a definition, the system puts thedisputed object into the Dispute queue (1618) and locks the object fromfurther approvals. At 1620, if the dispute is rejected, the systempasses the object back to the Approval queue and unlocks the object forapproval. At 1622, if the dispute is upheld, the system passes theobject back to the Documentation queue and unlocks the object for edit.

FIG. 17 illustrates an example user interface for displaying a workqueue. The interface includes an “Outstanding Definitions” section 1702listing objects for which metadata is to be entered, an “OutstandingApprovals” section 1704 listing data objects for which approval isrequired and an “Outstanding Disputes” section 1706 listing data objectswhere a dispute has been raised. For each object, the type of the objectis indicated (“Type”) along with the name of the object (“entity”).Names of parent and grandparent objects are also identified (inaccordance with the relevant hierarchical “tier” structure as describedbelow).

While the work queue interface may list all outstanding actions, moretypically, the work queue may be specific to a user, listing thoseactions allocated to that user. The user can then select an item in oneof the queues 1702, 1704, 1706 to invoke the relevant interface screensfor the metadata entry, approval, and dispute processes.

The interface may additionally provide a search function allowing theuser to search for particular objects. The search may be performed onobject name, on any of the collected object metadata, on object statusetc. (alone or in combination). In one example, the search results maybe presented in a user interface displaying the type of object, name,and parent and/or grandparent information as depicted in FIG. 17, andallowing the user to select an object to work on (e.g. to initiatemetadata entry, approval, or dispute resolution dependent on status).

In preferred embodiments the Metadata Manager tool maintains a hierarchyof objects (e.g. stored in a tree representation). This hierarchy can beinspected by way of an inspection interface, a simplified example ofwhich is illustrated in FIG. 18A.

In the illustrated example, the highest level 1802 of the hierarchy viewrepresents different classes of data sources. These top-level entitiesare referred to herein as hierarchies, and are configurable. Eachhierarchy has a number of sub-tiers, and the tree display may beexpanded and collapsed in order to display required sections.

Here, the hierarchy “Operational Data Store” is shown in expanded view.In this hierarchy, the first tier 1804 corresponds to different sourcedatabases, in this example listing two operational databases that havebeen imported into the data lake. The next tier 1806 of the hierarchylists the tables imported from the given database; here two tables areshown that were imported from the “CRM” database, namely the “CRMCLIENT” and “CRM_ADDR” table. The next tier 1808 lists the constituentfields or columns imported from a given table. A variety of informationis shown for each column—in this example, a column name 1810, keyindicator (e.g. private key PK or foreign key FK) 1812 ifapplicable/known and a description 1814. The description may be adescriptive label that was obtained as part of the metadata collectionprocess. Other metadata may of course be displayed here as well. Astatus indicator indicating the metadata collection status may also bedisplayed (e.g. using the status values summarised in Table 1 above).

The user may interact with the displayed entries (e.g. by way of a setof buttons displayed alongside each entry, not shown), for example toinvoke the metadata entry, approval and dispute functions for aparticular data object or view a history of metadata collection actions(entry/approval/dispute etc.). The Query Builder tool (described below)may also be invoked based on a selected table or column in order tocreate a data query using that table or column.

As mentioned above, hierarchies are user-configurable. FIG. 18Billustrates an example of a configuration screen 1820, here forconfiguring the “Operational Data Store” hierarchy. For each hierarchy,the user can specify one or more sub-tiers; here three sub-tiers aredefined, namely “DataSource” (i.e. the source database), “Table” and“Field” (where a field corresponds to a table column).

Each tier of a hierarchy corresponds to a type of object for whichmetadata may be collected. Thus, the metadata collection and approvalworkflow described previously may be applied to all objects at any ofthe tiers.

Instead of the described hierarchical relationships, the system couldalternatively allow metadata objects to be associated with each otherusing a more generalised model based on graph relationships, in whichany object can be related to any other object. The object browsinginterface could then be adapted accordingly, e.g. to allow display of agraph of metadata objects.

Metadata

For each type of object, corresponding to the “tiers” discussed above,the metadata that can be collected can be configured by users of thesystem. Specifically, users may define any number of metadata items, andmay further specify which object type(s) each metadata item is relevantto.

In one embodiment, the information specified by the user to define ametadata item may include:

-   -   Name    -   Label    -   Description    -   Placeholder (a value that will appear in the input field for the        metadata item when it is blank)    -   A data type (e.g. whether the metadata item is entered as        freeform text or numerical information or by selection from a        list of options)    -   The set of predefined list options for the metadata item (if the        metadata item is restricted to a specific set of values rather        than allowing freeform text entry)    -   The object types (corresponding to tiers in the defined        hierarchies) to which the metadata item applies    -   The class(es) of users who are required to approve the metadata        item    -   The class(es) of users who may edit the metadata item    -   A flag indicating whether the metadata item is required        (mandatory)

FIG. 19 illustrates an example screenshot for an interface 1900 forspecifying a metadata item. The interface includes a section 1902 forinputting various information about the metadata item, a section 1904for indicating the object types (or tiers) to which the metadata itemapplies, a section 1906 for indicating the required approvers (byspecifying user roles) and a section 1908 for indicating the permittedediting users (again in terms of roles). In this case the metadata itemis named “Information_Security_Classification”, and is defined as beingapplicable to the “Field” and “Result Column” tiers (object types). Thisparticular object is to be approved by the “Data Manager” and “BusinessData Owner” roles and can be edited by the “Developer” and “DataManager” roles. Note that for clarity not all the entry fields andoptions that would be used in a practical implementation are shown inthis simplified depiction of the user interface.

Metadata Entry and Approval

FIG. 20 illustrates a simplified representation of a user interface 2000for performing metadata entry and/or approval. The interface lists a setof metadata items 2002 that are applicable for the given object type ofthe selected object with input fields (which may be freeform text ornumerical input fields, check boxes, drop-down list selection fields, orany other appropriate input field, depending on the definition of themetadata item). Only a small number of metadata items are shown forclarity.

Furthermore, the interface provides a set of buttons 2004 for performingvarious actions, including saving changes, approving the metadata orraising a dispute. While for conciseness a single interface is shown, inpractice, entry and approval may have different interfaces. For example,the metadata entry screen may include only the “cancel”, “save”, and“save and submit” buttons, while the approval screen may include only“cancel”, “approve” and “dispute” buttons. The approving user may seethe metadata values in read-only form or may alternatively also be ableto edit prior to approval or resubmission (in which case all the buttonscould be provided in that mode).

The button actions may be as follows:

-   -   Cancel: Discard changes and return to last screen    -   Save: Save metadata changes without changing the object status    -   Save and submit: Save metadata changes and change status from        ““Being Documented” to “Being Approved” with the result that the        object will be added to the approval queue    -   Approve: confirm approval by the reviewing user. If all required        users have approved (or only a single approval is required) this        results in the object status changing to “Documented”, otherwise        the status remains as “Being Approved”    -   Dispute: Triggers creation of a dispute; a further interface may        be displayed e.g. as a pop-up box allowing the reviewing user to        enter a reason (e.g. selected from a predefined set of reasons)        along with detailed comments and explanations (e.g. to specify        any errors found in the metadata)

The metadata entry/display form is preferably generated dynamically. Todo this, after receiving a selection of a particular object to bedocumented (e.g. via the work queue depicted in FIG. 17, the hierarchydisplay of FIG. 18A or via a search) the system identifies the objecttype (corresponding to the hierarchy tier) and selects from the databaseof metadata items those metadata items defined as applicable to thatobject type. The form is then generated with input fields for therelevant metadata items. A definition is created in the database (whichmay e.g. be in the form of a definition record referencing multiplemetadata item records of the relevant item types). After the user saveschanges, the entered metadata item values are stored in the metadatarecord for the object in the metadata database.

Configuring Relationships

In a preferred embodiment, the metadata collection tool additionallyallows users to define relationships between tables (or morespecifically between table columns), and/or to document relationships byway of metadata using the same metadata collection process previouslydescribed. Thus, in such an embodiment, relationships may form anadditional type of object that can be documented by the system (inaddition to data sources, tables and fields/columns). Relationshipscould then also be represented in the information hierarchy (as depictedin FIG. 18A), e.g. as a tier below the “table” tier, or they could belisted and accessed separately.

FIG. 21 illustrates a simplified user interface 2100 for viewing,editing and/or adding relationships. In this example, it is assumed thatthe user has selected a particular table for which relationships are tobe inspected. The user may select via a selection input 2102 howrelationships are to be displayed, e.g. in text or graphical format (inthis case graphical view has been selected). Relationships for theselected table are then displayed in a view area 2104; here a singlerelationship involving columns 2106 and 2108 is shown (where column 2108is a column in another table). Labelled arrows 2110 and 2112 connect thepictorial representations of the columns and provide descriptive textdefining the nature of the relationship.

A search function 2114 is provided to allow new relationships to bedefined. The user can use the search function to find columns for whicha relationship is to be defined and can then use a further interface(not shown, e.g. a popup window) to specify information about therelationship including the labels that indicate the type ofrelationship.

The relationships depicted and manipulated via the interface may includerelationships already known to exist in the source data (e.g. ifrelationship information was extracted from the source database) as wellas those entered by users via the interface.

Additionally, the relationships may include relationships discovered bythe Table Analyser tool as described in more detail above (metadataobjects for discovered relationships may be automatically added to theMetadata Manager tool/documentation queue). The source of a relationshipmay be indicated in the interface (e.g. to distinguish automaticallydiscovered relationships).

In preferred embodiments, the user may further select a relationship toview its metadata collection status and/or invoke the workflows forentering/editing metadata for a relationship, approve/dispute metadatadefinitions, resolve disputes etc. as described above. Metadatacollection and approval for relationships preferably operatessubstantially as already described previously.

History

Users may display a history of the metadata collection process for anyselected object. The history may be displayed as a chronological listingidentifying metadata edits made and approval/dispute/dispute resolutionactions, indicating date/time and the user completing the action. Thehistory listing may show the status changes for an object (i.e.identifying events corresponding to status changes as per the statusvalues of Table 1 and the process as shown in FIGS. 15/16).

User Roles

The system preferably implements role-based access control forrestricting access to metadata objects to particular users. In thisapproach, users of the system may be assigned to various roles. Theroles are configurable. Examples of roles include:

-   -   Developer    -   Solution Architect    -   Data Manager    -   Admin    -   User    -   Business Data Owner

A user's role determines the actions the user may take in the system.For example, as described previously, metadata items may specify theuser roles that may edit the item and the roles from which approval ofthe particular item is required.

The system may also allow SLAs (service level agreements) to be definedfor each role, indicating the expected turnaround time for processingobjects (e.g. to document, or approve an object). This can then allowanalysis and reporting to check that the metadata collection process isoperating effectively.

The system may further providing reporting functions, e.g. to show useractivity over a defined time period for individual users, groups ofusers (e.g. specific roles) or all users. In one example, a report mayindicate a number of object definitions a user has added or edited, andthe number of those that were approved and disputed. Activity may alsobe summarised over time e.g. in graph form.

The Metadata Manager tool thus allows many users to cooperate increating metadata definitions relating to data objects imported into thedata lake. The metadata management process can also be extended to coverreports, business rules, and any other form of information handled by anorganisation. The described approach can have a number of benefits,including:

-   -   Agreed standard definitions can be created for data, business        rules, reports and other information entities.    -   Accelerated design of information systems    -   Enables “self-service” access to large and complex data by end        users    -   The captured metadata documentation may facilitate legal &        regulatory compliance    -   The system enables a crowd-sourced or federated approach to        gathering and populating metadata information        Data Lake Synchronisation

In preferred embodiments, the Metadata Manager tool is integrated withthe data lake and Data Tap tool by way of automatic synchronisationfunctionality, allowing the Metadata Manager to maintain an up-to-dateview of the contents of the Hadoop data lake.

The synchronisation component automatically provides details of the datastructures, objects, and associated technical metadata that reside onthe Hadoop platform.

As new objects appear in the Hadoop platform, workflow can beautomatically triggered to begin the documenting and categorising thedescriptive metadata associated with it. Over time this enablesindividual users and corporate enterprises to maintain current andhistorical views of their entire big data estate residing on Hadoopplatforms.

The synchronisation process is illustrated in FIG. 22. In this example,a data lake (Hadoop platform) 108 is illustrated comprising multipleHadoop/Hive databases each sourced from multiple data sources andincluding data corresponding to tables of those data sources. Metadatarepository 2210 contains the metadata objects and associated metadatamanaged by the Metadata Manager tool and is periodically synchronisedwith the data structures on a Hadoop platform 108.

A capture process 2202 is used to gather the details of the datastructures and associated technical metadata (e.g. schema metadata)currently residing on the Hadoop platform 108. A subsequent differencecalculation process 2204 uses this information and compares it to thedata structures and metadata already held within the repository 2210.The process 2204 determines the differences in structure and metadatasince the last execution, and calculates a list of changes that need tobe applied to the repository 2210 in order to bring it up-to-date, andthese are stored as change details 2205.

A change update process 2206 is then performed to apply the identifiedchanges to the repository 2210. The changes may create, update, or markas deleted objects with the repository 2210. The change process alsoupdates the audit history 2212 with details of any changes made, so thata full list of changes over time is maintained. Preferably, physicaldeletes are not performed in the repository 2210 in order to maintain afull history of previous activities and object details but informationmay instead be marked as no longer valid.

For example, if a new table has been imported into the Hadoop data lake,the capture process 2202 will obtain a description of the table and itsconstituent columns from Hadoop (in the form of “technical” or schemametadata for the Hive/Hadoop database). The difference calculationprocess will identify these as new entities since correspondingdocumentation metadata does not exist in the metadata repository 2210.The change update process 2206 may then create metadata objects in therepository corresponding to the new entities in the data lake, forexample an object representing the new table along with objectsrepresenting each column of the table. These objects may then be addedautomatically to the documentation queue 1500, thereby triggering thedocumentation workflow of FIG. 15, to allow documentation metadata to becollected for the new database entities.

Query Builder

Data warehouses are conventionally built using a “schema-on-write”(early binding) approach. Before any data can be loaded onto theplatform, a significant amount of time and effort often needs to bespent designing its physical data structure to accommodate all thepossible ways in which the data will be consumed. This is to ensure thatall the data dimensions are correctly conformed, and that all thebusiness transformations contain the correct logic. This typically meansthat a requirements/solution design cycle is needed between the businessand software development teams.

In preferred embodiments of the present system, the data lake is insteadbuilt using a “schema-on-read” (late binding) approach. This means thatdata gets loaded onto the platform straight away (by the Data Tap tool),without necessarily needing to consider how the data may be used. Atthis point, the raw data is accessible for users to consume, based upontheir roles and permissions. This method can provide much quicker accessto data and requires less effort; however it does requires that theconsuming user effectively builds their own schema into their query whenconstructing a new dataset and/or report. The Query Builder tool enablesusers to create, store and document these queries so that they aresearchable and re-useable between individual roles, making use of datamaintained by the Metadata Manager Tool and relationships discovered bythe Table Analyser tool. Hence over time knowledge is developed andevolved detailing how data is distributed between source tables/files,and how it can be combined/joined and selected/filtered to produceuseful data assets.

In a conventional approach, each consuming user of a data warehouse orsimilar system would typically manage their own queries in isolationfrom one another, with the potential to use inconsistent logic anddisparate data, or to waste time and effort duplicating queries whichalready existed.

The Query Builder tool 113 (see FIG. 1) seeks to address some of thesedifficulties and provides a method to avoid potentially inconsistentlogic, disparate data, and duplication, in order to save time andeffort, and promote re-use and best practice.

This is achieved by making saved Query Builder queries available forother users to use, subject to their role and permissions.

In preferred embodiments, each saved query is represented as an objectin the Metadata Manager, following the same metadata collection/approvalworkflow described above for other objects. As a result, queries willbecome documented, approved, and fully searchable.

Users are able to search for existing approved queries by using metadataassociated with the query by the Metadata Manager, for example bysearching for a query description, keyword, and/or subject area. Once aspecific query has been found, a user may either run it as is, or (ifmodifications are needed) may clone a copy and edit it, before savingand running the modified query.

The Query Builder tool also allows users to build their own queries fromscratch via a graphical user interface. The tool enables users to selectcolumns from tables stored in the data lake based on the metadatacontained within the Metadata Manager tool, and then to select tablejoins based on relationships identified by the Table Analyzer tool.Furthermore, users are able to specify additional criteria such asfilter criteria (e.g. “WHERE” restrictions), and grouping/aggregationcriteria (e.g. “GROUP BY”, “COUNT”, “SUM”, and “SORT” criteria).

In preferred embodiments, the Query Builder tool executes queriesdirectly on the data lake platform using the optimum method fordelivering the best performance. This may include technologies such asSpark, Java Map-Reduce, TES, and/or Hive.

The Query Builder tool allows the user to select Hive tables 110 in thedata lake 108 to form the basis of a query. The Query Builder tool canthen suggest possible join-type relationships, based on manually definedrelationships and also based on the output of the relationship discoveryprocess carried out by the Table Analyzer tool as described above.

Where automatically discovered relationships are used, the toolpreferably also indicates information on the strength of the possiblerelationship, such as the CP or the rank computed previously. While theTable Analyzer may be run on demand after tables have been selected fora query, it may be preferable for performance reasons to run the TableAnalyzer in advance (e.g. whenever new tables, or new data for existingtables, is imported into data lake 108), so that the relationshipinformation is available when needed in the Query Builder.

The user can then inspect the proposed relationships, table metadata(and possibly also table contents) and select the appropriate joinrelationship for the construction of the query.

An example user interface of the Query Builder tool is depicted in FIGS.23A and 23B. FIG. 23A illustrates an interface 2300 of the Query Builderdisplaying two tables 2302 and 2304 selected for the query by the user.These tables may have originated from different data sources and thusthe relationships between the tables may not be known a priori. Theinterface also proposes a number of possible relationships 2306 betweenthe tables which may have previously been discovered by the TableAnalyzer (illustrated as labelled lines connecting the respectivecolumn/field names of the respective tables). A visual indication of therelationship strength (based on the data computed by the Table Analyzeras described above) is provided by way of the color and/or line weightused to represent the connections between tables—here a relationshipbetween the CUSTID column of table 2302 and the CUSTID column of table2304 is identified as the strongest relationship. The user may be ableto view more detailed relationship information for each relationship,including collected metadata and/or the various statistical informationcomputed by the Table Analyzer (e.g. by clicking on or hovering over arelationship in the interface).

The user then selects the required relationship e.g. by clicking on thelink or label. At that point a second screen 2310 (FIG. 23B) may then bedisplayed to allow the user to specify additional parameters of thequery, such as which columns to include in the query output, the querycriteria, and any grouping/aggregation/sorting to be performed.

After defining the query the query can then be executed to retrieve datafrom the data lake. In preferred embodiments, based on the user input aquery statement or script is generated in accordance with an appropriatedata query language, e.g. HQL or SQL. The generated query includes atable join based on the selected relationship, i.e. with a join definedon the table columns to which the relationship relates (this may be donee.g. by adding a WHERE statement or similar, such as “WHERE T1.A=T2.13”to define a join condition between table 1 column A and table 2 columnB). The join type (e.g. inner/outer and left/right/full join etc.) maybe specified by the user or a default join type may be used.

The query is then executed, e.g. in the case of the Hadoop system bysubmitting the generated HQL statement to Hive. Hive executes the queryand returns the results to Query Builder or other relevant component(e.g. data analytics component 112). The query results may also betransmitted to a user device 116 (e.g. PC terminal or mobile device) fordisplay to the user, stored as a new table in the data lake 108, ortransmitted to a remote computer system for further processing.

In addition to direct execution the query can be saved in the system andif appropriate published to make it available for other users. Once aquery has been added to the system it may be processed by the MetadataManager tool (i.e. by way of a metadata object representing the querywhich is added to the metadata repository and which is processed via themetadata collection/approval process as previously described).

While FIGS. 23A-23B illustrate a relatively simple query with twotables, more complex queries may be constructed including more than twosource tables and/or multiple join relationships. Queries may also becombined by nesting (e.g. by using query output from one query as inputto another query in place of a source table).

FIG. 24 illustrates various processes that may be performed utilizingthe Query Builder tool (supported by the Query Builder user interfacee.g. as depicted in FIGS. 23A-23B).

Firstly, information on existing queries held in metadata repository2210 may be viewed, browsed and/or searched and queries may be selectedin step 2402.

A new query creation process 2404 may be invoked and may include thefollowing illustrative steps:

-   -   Step 2406: Data for the query is selected—e.g. selecting        particular tables from which data is to be obtained. The        selection may be done utilising table metadata in repository        2210 (e.g. via a metadata search function).    -   Step 2408: One or more relationships between the tables to serve        as table joins for the query are specified—these may be        predefined relationships or relationships found by the Table        Analyser (in which case the relationship metadata in repository        2210 may be used to identify suitable relationships).        Alternatively, join relationships may be explicitly specified by        the user.    -   Step 2410: Filter and Sort/Aggregation criteria and the like may        be specified.    -   Step 2412: A preview of the query output is preferably generated        to assist the user in verifying correct operation.    -   Step 2414: The query is saved (optionally being made available        to other users for reuse).

The user may vary the order in which steps are performed, may omit somesteps, and may at any point return to earlier steps to revise the querydefinition after completing later steps.

A query clone/edit process 2416 may be invoked for an existing storedquery. In that case the query builder creates a copy of the querydefinition from the stored query and the process may then include thefollowing illustrative steps:

-   -   Step 2418: The data selection may be modified (e.g. adding,        removing or changing selected source tables).    -   Step 2420: The joins may be modified (e.g. by changing the        relationship used as the basis for a table join).    -   Step 2422: Sort/aggregation and filter criteria may be changed.    -   Step 2424: An output preview is generated.    -   Step 2426: The edited query is saved.

The user may vary the order in which steps are performed, may omit somesteps, and may at any point return to earlier steps to revise the querydefinition after completing later steps.

A documentation and test process 2428 may include the followingillustrative steps:

-   -   Step 2430: Metadata is entered for the query.    -   Step 2432: The query metadata is approved (steps 2430 and 2432        may be performed within the Metadata Manager tool).    -   Step 2434: The query can be tested e.g. by executing the query        and inspecting results.    -   Step 2436: The query may be scheduled for execution e.g. at a        particular time and/or periodically. For a scheduled query, the        system then automatically executes the query in accordance with        the specified schedule, with results stored for subsequent        access, review, and processing.

The steps may be performed in a different order and not all steps maynecessarily be performed (e.g. scheduling may only apply to certainqueries).

System Architecture

A high-level software architecture for implementing the described system(including the Data Tap, Table Analyzer, Metadata Manager and QueryBuilder tools) is shown in FIG. 25A.

The system is based around the data lake 108. This includes distributedstorage 2504 for storing table data extracted from source databases bythe Data Tap tool, and database 2502 for storing management data, suchas the metadata repository containing metadata collected by the MetadataManager tool, user data and other data used by the system.

An API (Application Programming Interface) 2506 is provided forinteracting with the information stored in the distributed storage 2504and database 2502. A set of workflow processes 2508 are implementedusing the API, e.g. to implement the Data Tap data ingestion, TableAnalyzer relationship discovery, and metadata collection/approvalprocesses. A client user interface (UI) 2510 handles the userinteractions. While a standalone client application could be provided,in preferred embodiments the client UI is preferably implemented as aweb application running in a browser. Other applications 2512 mayintegrate with the system via API 2506. Reporting functions 2514 (e.g.,a QlikView reporting solution) may access the database 2502 or otherinformation in the data lake directly (though could alternatively alsoaccess the information through extensions to the API).

Metadata may be stored in versioned form in the database 2502, e.g. toallow changes to be undone or a history of changes to be inspected.

FIG. 25B illustrates a specific example of the above architecture. Here,the distributed storage 2504 is implemented via the Apache Hive HDFS asdescribed previously. Database 2502 in implemented as a MySQL database.The API 2506 is implemented based on a Scalatra web micro-framework withthe client UI 2510 implemented using the AngularJS web applicationframework. A QlikView reporting solution 2514 is provided. A variationof the architecture is shown in FIG. 25C, in which an Apache HBASEdatabase is used as the database 2502 (which may reside in the HadoopHDFS).

Aspects of the above system may be implemented on one or more computingnodes—e.g. a cluster of hardware servers.

FIG. 26 illustrates an example of a hardware/software architecture of aserver node 2600 which may be used to implement methods and techniquesdescribed herein. The server includes one or more processors 2602together with volatile/random access memory 2606 for storing temporarydata and software code being executed.

A network interface 2604 is provided for communication with other systemcomponents (e.g. other servers in a Hadoop cluster 2620, where theserver 2600 is operating as part of a cluster) and a wider network 2622(e.g. Local and/or Wide Area Networks, including the Internet), forexample, for connection to data sources 102, user terminals 116 andother devices.

Persistent storage 2608 (e.g. in the form of hard disk storage, opticalstorage, solid state storage and the like) persistently stores softwarefor performing the various functions, including one or more of: a DataTap module 106 for importing data from data sources 102 into the datalake 108, Table Analyzer module 107 for identifying table relationshipsusing the methods set out above, Metadata Manager module 109 forimplementing the metadata collection and approval processes describedabove, and Query Builder module 113 to enable creation and execution ofqueries based on the identified relationships.

The persistent storage also includes other server software and data (notshown), such as a server operating system. The server will include otherconventional hardware and software components as known to those skilledin the art, and the components are interconnected by a data bus (thismay in practice consist of several distinct buses such as a memory busand I/O bus).

While a specific software and hardware architecture is shown in FIGS.25A-25C and FIG. 26 by way of example, any appropriate hardware/softwarearchitecture may be employed and any suitable hardware, database, APIand UI technologies may be used.

Furthermore, functional components indicated as separate may be combinedand vice versa. While in this example, a range of different processes106, 107, 109 and 113 are shown as implemented on the server, inpractice these processes may be distributed across multiple servers,e.g. with different servers handling data import, table analysis andmetadata collection functions. Thus, functionality may be distributedover any number of computing devices in any suitable manner. Inpreferred embodiments, where appropriate, modules may operate in aparallelized fashion (e.g. using Hadoop map-reduce) across multiplephysical or virtual servers or compute nodes in a Hadoop cluster asalready set out in more detail for the Table Analyzer tool.

The data lake 108 (FIG. 1) may be implemented as persistent storagedistributed over a number of servers in the Hadoop cluster (e.g. in theform of a Hadoop distributed file system). Those servers may providedata storage only or may combine data storage with any of the previouslydescribed processing functions.

It will be understood that the present invention has been describedabove purely by way of example, and modification of detail can be madewithin the scope of the invention.

Script Samples

SAMPLE 1: The following is a sample Sqoop script for performing aninitial load for the “TJ30T” source table 104 as depicted in FIG. 5B:

source $1 sqoop import -D oraoop.jdbc.url.verbatim=true -Dmapred.job.queue.name=${queueName} -Dmapred.job.name=TJ30T_SQOOP_INITIAL_LOAD -Djava.security.egd=file:/dev/../dev/urandom -D mapred.child.java.opts=″-Djava.security.egd=file:/dev/../dev/urandom″ --direct --connectjdbc:oracle:thin:@//${host_name}:${port_number}/${db_instance}--username ${username} --password ″${password}″ --num-mappers${sqoopMappers} -- hive-import --hive-overwrite--hive-delims-replacement ″ --null-string ″ --null- non-string ″ --tablesourcedb.″TJ30T″ --target-dir/user/hdp_batch/sourcedb//initial/crm/crm_tj30t --map-column-hiveMANDT=STRING,STSMA=STRING,ESTAT=STRING,SPRAS=STRING,TXT04=STRING,TXT30=STRING,LTEXT=STRING --hive-tableprod_landing_initial_area.crm_tj30t

SAMPLE 2: The following is a sample HQL script for creating a Hive tablein the data lake corresponding to the FIG. 5B table:

USE ${hivevar:DATABASE}; CREATE ${hivevar:EXTERNAL} TABLE IF NOT EXISTScrm_tj30t${hivevar:LABEL} ( ${hivevar:ERRORS} jrn_date STRING COMMENT ″,jrn_flag STRING COMMENT ″, tech_closure_flag STRING COMMENT ′Utilityfiled for closure flag′, tech_start_date STRING COMMENT ″, tech_end_dateSTRING COMMENT ″, mandt STRING COMMENT ″, stsma STRING COMMENT ″, estatSTRING COMMENT ″, spras STRING COMMENT ″, txt04 STRING COMMENT ″, txt30STRING COMMENT ″, Itext STRING COMMENT ″ ) COMMENT ″ PARTITIONED BY(tech_datestamp STRING COMMENT ′YYYY-MM-DD on which partition wascreated′, tech_type STRING COMMENT ′OPEN, DELTA, CLOSED′, tech_numSTRING COMMENT ′ops partition, sequence number of the load′) ROW FORMATDELIMITED FIELDS TERMINATED BY ′\001′ STORED AS SEQUENCEFILETBLPROPERTIES( ″mapreduce.output.fileoutputformat.compress″=″true″,″mapreduce.output.fileoutputformat.compress.type″=″BLOCK″,″mapreduce.output.fileoutputformat.compress.codec″=″org.apache.hadoop.io.compress.GzipCodec″ );

SAMPLE 3: The following is a sample HQL script for performing an initialload of the Hive table:

USE ${hivevar:DATABASE}; SETmapred.job.queue.name=${hivevar:QUEUE_NAME}; SEThive.merge.size.per.task=100000000; SEThive.merge.smallfiles.avgsize=100000000; SET hive.exec.parallel=true;SET hive.exec.parallel.thread.number=50; SEThive.exec.compress.output=true; SETmapred.output.compression.codec=org.apache.hadoop.io.compress.GzipCodec; SET mapred.output.compression.type=BLOCK; INSERT INTO TABLEcrm_tj30t PARTITION (tech_datestamp=′${hivevar:DATESTAMP}′,tech_type=′ORIGINAL′, tech_num=′${hivevar:NUM}′) SELECT′${hivevar:DATESTAMP} 00:00:00.0′ as jrn_date, ′ORIGINAL′ as jrn_flag,NULL as tech_closure_flag, NULL as tech_start_date, NULL astech_end_date, mandt, stsma, estat, spras, txt04, txt30, Itext FROM${hivevar:INITIAL_DB}.crm_tj30t;

Corresponding Sqoop and Hive scripts for performing subsequent deltaloads would also be provided.

SAMPLE 4: The following is a sample HQL script for modifying a tabledefinition to add a column:

USE ${hivevar:DATABASE}; ALTER TABLE crm_tj30t ADD COLUMN (COL1 STRING);

SAMPLE 5: The following is a sample updated Sqoop script for importingthe modified table (initial load; a corresponding modified delta loadscript would also be generated):

source $1 sqoop import -D oraoop.jdbc.url.verbatim=true -Dmapred.job.queue.name=${queueName} -Dmapred.job.name=TJ30T_SQOOP_INITIAL_LOAD -Djava.security.egd=file:/dev/../dev/urandom -D mapred.child.java.opts=″-Djava.security.egd=file:/dev/../dev/urandom″ --direct --connectjdbc:oracle:thin:@//${host_name}:${port_number}/${db_instance}--username ${username} --password ″${password}″ --num-mappers${sqoopMappers} -- hive-import --hive-overwrite--hive-delims-replacement ″ --null-string ″ --null- non-string ″ --tableSAPCRM.″TJ30T″ --target-dir/user/hdp_batch/sapcrm//initial/crm/crm_tj30t --map-column-hiveMANDT=STRING,STSMA=STRING,ESTAT=STRING,SPRAS=STRING,TXT04=STRING,TXT30=STRING,LTEXT=STRING, COL1=STRING --hive-tableprod_landing_initial_area.crm_tj30t

Corresponding modified HQL initial/delta load scripts could also begenerated as needed.

SAMPLE 6: The following is a sample Sqoop template.

″sqoop import -D mapred.job.name=${sqoop_table_name} SQOOP_INITIAL_LOAD-D mapred.job.aueue.name=${queueName}″ +″-Djava.security.egd=file:/dev/../dev/urandom″ + ″-Dmapred.child.java.opts=\′′\\-Diava.security.eqd=${sqoopSecurityFile}\″″ + ″--connectjdbc:oracle:thin:@//${sqoopSourceServer}/${sqoopSchema}″ + ″-username${sqoopUsername} --password \″${sqoopPassword}\″ ″ + ″--num-mappers${numOfMappers} --hive-import -hive-overwrite --hive- drop-import-delims″ + ″--null-string ″ --null-non-string ″ ″ + ″--query ′SELECTROW_NUMBER, ${sqoop col str tmp} FROM ( select ${ora hash str}$(sqoopcol str tmp}″ + ″FROM ( select ${sqoop col str} FROM${schemaName}.\″$(sqoop table name}\″)) ″ + ″WHERE $CONDITIONS′ ″ +″--target-dir ${sqoopTargetDir}/initial/${sourceSystem}/${hive tablename}″ + ″--split-by ROW_NUMBER --map-column-hive ${hive col str} ″ +″--hive-table ${tempLandingArea}.${hive table name}″

The template includes an invocation of the Sqoop tool with relevantparameters, including an embedded database query (here SQL) forretrieving the required data from the source database. The templateincludes placeholder variables of the format ${variable_name}. Theseplaceholder variables are substituted during script generation with theapplicable values. For example, ${sqoop_table_name} is substituted bythe relevant table name and ${sqoop_col_str_tmp} is substituted with thelist of columns being imported. Hive templates may be constructed in ananalogous fashion.

Further Aspects and Features.

The following sets out further aspects and preferred features, which maybe provided independently or combined with the aspects set out above andin the appended claims in any appropriate manner.

Data Tap

In one aspect of the invention, there is provided a computer-implementedmethod of importing data from a data source to a target storage system,wherein the data is stored at the data source in accordance with asource data schema, the method comprising: executing an automated dataimport process to retrieve data from the data source and update thetarget storage system based on the retrieved data, the automated dataimport process operating in dependence on the source data schema;detecting a change in the source data schema; in response to detectingthe change in the source data schema, modifying the automated dataimport process based on the detected change; and executing the modifiedautomated data import process to retrieve further data from the datasource and update the target storage system based on the furtherretrieved data.

The data source may be a source database, e.g. managed by a databasemanagement system. The step of detecting a change in the source dataschema preferably comprises retrieving metadata from the data sourcedefining the source data schema for the data, and comparing the metadatato previously stored metadata for the data source to identify one ormore changes to the source data schema. The metadata thus preferablyrelates to the configuration of the source database, in terms of thedata schema (e.g. the structural organization of the source data). Themethod may comprise storing the retrieved metadata in a metadatarepository. The previously stored metadata may have been obtained duringa previous operation of the process, and may be stored in the metadatarepository, which may be updated based on detected metadata changes.

The method preferably comprises configuring the automated data importprocess in dependence on the metadata. Preferably, the automated dataimport process is defined by a set of stored executable data importand/or manipulation instructions, the method comprising modifying orregenerating one or more of the executable instructions in dependence onthe changed source data schema. The instructions may, for example,comprise instructions or statements in a data query/manipulationlanguage and/or instructions to a data import program (e.g. asparameterized invocations of the data import program).

The stored executable instructions are preferably in the form of one ormore import scripts (where a script may include one or moreinstructions). For example, the scripts may comprise scripts comprisingdata query language statements (e.g. SQL/HQL) and/or may comprise shellscripts (e.g. invoking a data import program) and/or may comprisescripts in any suitable scripting language. Scripts may generally(though not necessarily) comprise instructions in textual/human-readableform. Preferably, the method comprises modifying or regenerating theimport scripts in dependence on the modified source data schema and/orthe retrieved metadata.

The import scripts may comprise: a data retrieval script for retrievingdata from the data source in accordance with the source data schema, andan update script for updating the target storage system in dependence onthe retrieved data. The import scripts may comprise at least a firstdata retrieval script for performing a complete import of a source tableof the data source, and a second data retrieval script for performing anincremental import of changes to the source table (e.g. changes since alast run of the import process). The import scripts may comprise atleast a first update script for updating the target storage system byperforming a complete import of a source table of the data source, and asecond update script for incrementally applying a set of changes made tothe source table to the target storage system (e.g. since a last run ofthe import process). In one example, data retrieval scripts may compriseSqoop scripts and/or update scripts may comprise Hive Query Languagescripts.

Preferably, modifying the automated data import process comprisesgenerating one or more import scripts in dependence on the source dataschema and/or retrieved metadata. The method may comprise generating theone or more import scripts based on retrieved metadata defining thesource data schema and based on one or more script templates. Forexample, after identifying one or more appropriate stored scripttemplates, the script templates (which may include incomplete sectionsand/or placeholders) may be populated based on retrieved metadata toform import scripts.

The method may comprise retrieving a script template from a plurality ofstored script templates, each of the stored script templates associatedwith a given data source type, the retrieved script template selectedbased on the type of the data source from which data is being imported,preferably wherein the data source type indicates a database managementsystem managing the data source; and modifying the template based on theretrieved metadata to generate a data import script.

The method may further comprise modifying a data schema for the targetstorage system in dependence on the detected change in the source dataschema, wherein the modified automated data import process updates thetarget storage system based on the modified target data schema.

Preferably, the method comprises classifying a type of the change to thesource data schema, and modifying the automated data import process independence on the type of change, the method optionally comprising:modifying a target data schema and/or an import script for a sourceschema change comprising one of: an addition of a column, a deletion ofa column, and an index change. The method may comprise, for a givenchange type, not modifying a target schema and/or not modifying importscripts. Thus certain change types may be ignored during the import.

Executing the automated data import process preferably comprisesacquiring difference information specifying changes to data stored inthe data source (e.g. since a last run of the import process or since alast time difference information was generated or acquired). Thedifference information may be received from the data source, or themethod may include generating the difference information. In the lattercase, the method preferably comprises receiving a data set from the datasource; comparing the received data set to a previously stored versionof the data set and generating the difference information based on thecomparison. The data set preferably comprises a set of records (e.g. inthe form of a database table), the method comprising identifying one ormore identifier fields of the set of records that uniquely identifyrespective records, preferably one or more primary key fields, andcomparing the values of the identifier fields to values of said fieldsin the previously stored version of the data set to identify datachanges. The comparing preferably comprises one or more of: in responseto a record having an identifier field value not present in thepreviously stored version of the data set, identifying the record as aninserted record; in response to a record having an identifier fieldvalue present in the previously stored version of the data set,comparing the record to the corresponding previously stored record, andidentifying the record as an updated record if they differ; in responseto identifying a field value present in the previously stored version ofthe data set but not the retrieved data set, identifying the record as adeleted record. The data set may comprise a set of data records storedin a table in the data source. Preferably, one or more updates aregenerated based on the difference information and the updates areapplied to the target storage system.

Preferably, the difference information comprises a plurality of datachange entries, each data change entry relating to a changed record andspecifying one or both of: an update type, the update type preferablyselected from the group consisting of at least insert, update, anddelete; and one or more (old or new) field values of the changed record.

Preferably, the data source comprises a relational database, the importoperation relating to a given source table of the relational database,the detecting step retrieving metadata defining a data schema of thegiven source table, preferably wherein the automated data import processis configured to retrieve data from the given source table of the datasource and update a target data structure at the target storage systemcorresponding to the given source table based on the retrieved tabledata.

The method may comprise partitioning the source table into partitions atthe target storage system, the partitions optionally stored in separatedata containers or files, preferably wherein the data import isperformed in parallel by a plurality of import processes, each importprocess arranged to generate a respective partition at the targetstorage system. The method may comprise storing data in the targetstorage system in a directory structure, preferably wherein filescorresponding to partitions of a given source table are stored in acommon directory associated with the source table (e.g. this may involvestoring files corresponding to different tables in differentdirectories).

In an embodiment, data import is performed using a parallelizedmap-reduce algorithm.

The target storage system may comprise a storage system other than arelational database, preferably a storage system based on Hadoop and/orHive.

The method may comprise maintaining at least two databases in the targetstorage system, the first database comprising a current version of dataimported from one or more data sources, the second database comprisinghistorical data of the one or more data sources, the method optionallycomprising: updating, by the automated data import process, the firstdatabase based on data retrieved from a data source; and maintaining oneor more past versions of data modified by the data import process in thesecond database.

The method may further comprise reordering columns of a source tableduring import such that one or more key columns are placed first in acolumn order of the imported data in the target storage system.

In a further aspect of the invention, there is provided a data importsystem for importing data from a data source to a target storage system,wherein the data is stored at the data source in accordance with asource data schema, the system comprising: an automated data importprocess configured to retrieve data from the data source and update thetarget storage system based on the retrieved data, the automated dataimport process adapted to operate in dependence on the source dataschema; a data schema monitoring module adapted to detect a change inthe source data schema; and a configuration module adapted, in responseto detecting the change in the source data schema, to modify theautomated data import process in dependence on the change. The systemmay be configured to perform any method as set out above.

Table Analyser

In a further aspect of the invention, there is provided a method ofidentifying relationships between data collections, each data collectioncomprising a plurality of data records, the method comprising:evaluating a plurality of candidate relationships, each candidaterelationship defined between a first set of data values associated witha first data collection and a second set of data values associated witha second data collection, the evaluating comprising computingrelationship metrics for each candidate relationship, wherein therelationship metrics for a candidate relationship provide a measure of arelationship between the first value set and the second value set, thecomputing comprising: computing a first metric indicating a degree ofdistinctness of values of at least one of the first and second valuesets; and computing a second metric indicating a measure of overlapbetween values of the first value set and values of the second valueset; the method further comprising identifying one or more relationshipsbetween data collections in dependence on the computed relationshipmetrics.

The first and second value sets preferably define respective first andsecond candidate keys of the respective data collections. The termcandidate key preferably refers to data derived from a data collectionthat may be used in identifying data records, e.g. as a primary key orforeign key (whether or not actually defined or used as a key in thesource data), and hence a candidate key may serve as a source or targetof a relationship between data collections. Such a candidate keytypically corresponds to a set of values taken (or derived) from a givenfield or combination of fields of a data collection (with respective keyvalues taken/derived from respective records of the collection).

The term “degree of distinctness” preferably indicates a degree to whichvalues of a value set (e.g. defining a key) are distinct (different)from each other (e.g. in other words this may relate to the degree ofrepetition of values within the value set). Thus, value sets havingfewer repeated values (in absolute or more preferably relative terms)may be considered to have a higher degree of distinctness than valuesets having more repeated values. The term “overlap” preferably refersto a degree to which values in one value set/key are also found in theother value set/key. The term “metric” preferably refers to any measureor indicator that may be calculated or otherwise determined (metrics maybe expressed numerically or in any other way).

Preferably, each data collection comprises data records each having oneor more data fields, and wherein the first and/or second value set (fora given candidate relationship) comprises: a set of values of one ormore data fields of its associated data collection; or a set of valuesderived from one or more data fields of its associated data collection.The first and/or second value set may comprise (for a given/at least onecandidate relationship) a combination or concatenation of field valuesof two or more fields of the associated data collection.

Preferably, the first and/or second value set comprises a plurality ofvalues, each value derived from a respective record of the associateddata collection, preferably wherein the values of the value set arederived from one or more corresponding fields of respective records.Corresponding fields are preferably fields that separate records have incommon, e.g. they are the same field according to the data schema of thedata collection (e.g. a value set may correspond to one or moreparticular columns of a table or one or more particular attributes of anobject collection). One or more predefined values of the given field(s)may be excluded from the set of values forming a candidate key, e.g.null values or other predefined exceptions. Thus, in that case theanalysis may be performed only in relation to non-null and/ornon-excluded candidate key values.

Preferably, the data collections comprise tables (e.g. relationaldatabase tables), the records comprising rows of the tables, preferablywherein the first value set comprises a first column or columncombination from a first table and wherein the second value setcomprises a second column or column combination from a second table. Inthe context of relational database tables, the terms “row” and “record”are generally used interchangeably herein, as are the terms “column” and“field”.

The method may involve evaluating candidate relationships involving (ascandidate key) at least one, and preferably a plurality of differentfield/column combinations of the first and/or second data collections.Optionally all possible field/column combinations may be considered(e.g. up to a maximum number of fields/columns which in one examplecould be two or three; alternatively no limit could be applied).Possible combinations (e.g. up to the limit) may be filtered based onpredetermined criteria e.g. to eliminate unlikely combinations andthereby improve computational efficiency.

Preferably, the method comprises computing a relationship indicator forone or more (or each) of the candidate relationships, wherein therelationship indicator for a candidate relationship is indicative of astrength or likelihood of a relationship between the value sets formingthe candidate relationship and is computed based on the first and secondmetric for the candidate relationship.

Preferably, the first metric comprises a key probability indicatorindicative of the probability of the first value set or second value setbeing (or serving as/capable of serving as) a primary key for its datacollection. Computing a key probability indicator preferably comprises:computing, for the first and second value sets, respective first andsecond probability indicators indicative of the probability of therespective value set being a primary key for its data collection, anddetermining the key probability indicator for the candidate relationshipbased on the first and second probability indicators. The keyprobability indicator for the candidate relationship may be determinedas (or based on) the greater of the first and second probabilityindicators. The method may comprise determining a probability that avalue set is a primary key for its data collection based on a ratiobetween a number of distinct values of the value set and a total numberof values of the value set (or the total number of records in the datacollection). As mentioned above, null values and optionally otherdefined exceptional values may not be considered as valid key values andmay not be counted in determining the number of distinct values and/orthe total number of values in a value set. Thus, the term “key values”may be taken to refer to values of a key which are not null andoptionally which do not correspond to one or more predefined exceptionalvalues.

Preferably, the second metric comprises an intersection indicatorindicative of a degree of intersection between values of the first andsecond value sets. Computing the intersection indicator preferablycomprises: computing a number of distinct intersecting values betweenthe first and second value sets, wherein intersecting values are valuesappearing in both the first and second value sets; and computing theintersection indicator for the candidate relationship based on a ratiobetween the number of distinct intersecting values and a total number ofdistinct values of the first or second value set. As before null valuesand optionally other defined exceptional values may be excluded from thecounts of distinct intersecting values and/or distinct values ofrespective value sets.

Throughout this disclosure, the distinct values of a set are preferablyconsidered the set of values with repeated values eliminated, i.e. a setin which each value differs from each other value.

Preferably, the method comprises: computing a first ratio between thenumber of distinct intersecting values and the total number of distinctvalues of the first value set; computing a second ratio between thenumber of distinct intersecting values and the total number of distinctvalues of the second value set; and computing the intersection indicatorin dependence on the first and second ratios. The method may comprisecomputing the intersection indicator as (or based on) the greater of thefirst and second ratios.

Preferably, the method comprises computing the relationship indicatorfor a candidate relationship based on the product of the key probabilityindicator and intersection indicator.

The step of identifying one or more relationships may compriseidentifying a possible relationship between value sets of respectivedata collections in response to one or more of the first metric, thesecond metric and the relationship indicator for a candidaterelationship exceeding a respective predetermined threshold.Alternatively or additionally, the method may comprise ranking aplurality of candidate relationships in accordance with theirrelationship indicators and/or computed metrics, and/or associating arank value with the candidate relationships.

The identifying step preferably comprises generating an output data setcomprising information identifying one or more identified relationships,the output data preferably including computed relationship indicators,metrics and/or ranks.

In preferred embodiments, the data collections are data tables, thefirst and second value sets comprising columns of respective tables. Themethod may then comprise a plurality of processing stages including: afirst processing stage, comprising mapping values appearing in the datatables to column locations of those data values; a second processingstage, comprising computing numbers of distinct data values forrespective columns and/or numbers of distinct intersecting values forrespective column pairs; and a third processing stage comprisingcomputing relationship indicators based on the output of the secondprocessing stage. The first processing stage may further comprise one ormore of: aggregating, sorting and partitioning the mapped data values.One or more of the first, second and third processing stages may beexecuted by a plurality of computing nodes or processes operating inparallel. The method may be implemented as a map-reduce algorithm. Forexample, the first processing stage may be implemented using a mapoperation and the second processing stage may be implemented as a reduceoperation.

Preferably, the method comprises using at least one of the identifiedrelationships in the creation and/or execution of a data query toretrieve data from the one or more data collections, the data querypreferably specifying a join defined between respective keys of the datacollections, the keys corresponding to the value sets between which therelationship is defined.

In a further aspect of the invention (which may be combined with theabove aspect), there is provided a computer-implemented data processingmethod, comprising: computing data indicative of relationships betweencolumns of a plurality of data tables; receiving a user selection of atleast a first table having a first set of columns and a second tablehaving a second set of columns; providing indications of one or moresuggested relationships between respective columns of the first andsecond tables to a user, each indication preferably indicating astrength or likelihood of a relationship between one or more columns ofthe first table and one or more columns of the second table based on thecomputed data; receiving a user selection of one of the suggestedrelationships; and creating a data query based on the selected tablesand the selected relationship. The computing step may compriseperforming any method as set out above.

In either of the above aspects, the data query may specify a joinbetween the selected tables, the join defined with respect to thecolumns to which the selected relationship relates. The data query maycomprise a data query language statement, preferably an SQL (StructuredQuery Language) or HQL (Hive Query Language) statement. The method maycomprise executing the query to retrieve data from the data tables, andoptionally storing the query output and/or transmitting the query outputto a user device.

In a further aspect of the invention (which may be combined with any ofthe above aspects), there is provided a method of identifyingrelationships between data tables, each data table preferably comprisingone or more rows corresponding to respective data records stored in thetable, and one or more columns corresponding to respective data fieldsof the data records, the method comprising: computing a relationshipindicator for each of a plurality of key pairs, each key pair comprisingrespective first and second candidate keys selected from respective datatables, wherein the relationship indicator comprises a measure of arelationship between data of the first candidate key and data of thesecond candidate key; and identifying one or more relationships betweenthe data tables in dependence on the computed relationship indicators.

In a further aspect of the invention, there is provided a dataprocessing system comprising: data storage for storing data tables (eachdata table preferably comprising one or more rows corresponding torespective data records stored in the table, and one or more columnscorresponding to respective data fields of the data records); and atable analyser module configured to: compute a relationship indicatorfor each of a plurality of key pairs, each key pair comprisingrespective first and second candidate keys selected from the one or moredata tables, wherein the relationship indicator comprises a measure of arelationship between data of the first candidate key and data of thesecond candidate key; the relationship indicator preferably computedbased on a measure of distinctness of values of at least one of thefirst and second candidate keys and/or based on a measure of overlapbetween values of the first candidate key and values of the secondcandidate key; and output data specifying one or more relationshipsbetween candidate keys of the data tables in dependence on the computedrelationship indicators. The system may further comprise a query moduleconfigured to create and/or execute data queries on the data tablesusing relationships specified in the output data. The system may beconfigured to perform any method as set above.

What is claimed is:
 1. A computer-implemented method comprising thesteps of: maintaining a data repository, the data repository storingdata imported from one or more data sources; storing and managing, by ametadata management module, metadata, in a metadata repository, relatingto the data in the data repository; constructing, using a query builderinterface, a first data query, using first metadata from the metadatarepository, for querying the data in the data repository; storing thefirst data query in the metadata repository; creating a first metadataobject for the first data query in the metadata repository, and addingthe first metadata object to a documentation queue; constructing, usingthe query builder interface, a second data query, using second metadatafrom the metadata repository, for querying the data in the datarepository; storing the second data query in the metadata repository;creating a second metadata object for the second data query in themetadata repository, and adding the second metadata object to thedocumentation queue; searching existing queries based on existingmetadata objects stored in the metadata repository, the existingmetadata objects including the first and second metadata objects;selecting one of the existing data queries based on its metadata object;editing the selected data query to construct, using the query builderinterface, a third query using third metadata from the metadatarepository, for querying the data in the data repository; storing thethird data query in the metadata repository; and creating a thirdmetadata object for the third data query in the metadata repository, andadding the third metadata object to the documentation queue, wherein thefirst, second and third metadata objects are stored in the metadatarepository and are available for retrieval and execution or forretrieval and editing to create modified data queries.
 2. A methodaccording to claim 1 further comprising the steps of: in response toreceiving a selection of two tables as data sources for the first dataquery, identifying based on the stored metadata at least onerelationship between columns of the selected tables, and providing anindication of the identified at least one relationship on the querybuilder interface.
 3. A method according to claim 2, further comprisingthe step of displaying an indication of a relationship strength on thequery builder interface.
 4. A method according to claim 3, wherein theidentified relationships comprise one or more relationshipsautomatically identified by analysis of data in the data repository, therelationship strength indication being computed during the analysis. 5.A method according to claim 1, wherein the query builder interfacecomprises an interface for selection of data entities used in the first,second or third data query.
 6. A method according to claim 1, whereinthe query builder interface enables selection of: one or more sourcetables for a data query; and one or more table relationships betweenselected tables; the method further comprising creating the first,second or third data query based on the selected tables andrelationships.
 7. A method according to claim 6, wherein a selectedrelationship is used to define a table join on selected tables.
 8. Amethod according to claim 1, wherein the first, second and thirdmetadata objects for the first, second and third data queries areavailable to other users of the data repository.
 9. A method accordingto claim 1, wherein the query builder interface comprises a data entityselection interface for selection of data entities used in the first,second or third data query, the data entity selection interfacedisplaying the metadata for at least one data entity stored in themetadata repository.
 10. A method according to claim 1, furthercomprising at least one of the steps of: executing the first, second orthird data query; transmitting the results of the first, second or thirddata query to a user device, storing the results of the first, second orthird data query in the data repository, or transmitting the results ofthe first, second or third data query to a remote computer system.
 11. Amethod according to claim 1, wherein each of the first, second and thirddata queries comprises more than two tables and/or multiple joinrelationships and/or a nested query.
 12. A method according to claim 1,further comprising the steps of: after receiving the first metadata,adding the first metadata object to an approval queue; receiving apositive approval indication or a negative approval indication for thefirst metadata object from a second user via the metadata managementuser interface; and in response to a positive approval indication,marking the first metadata object as approved in the metadatarepository.
 13. A method according to claim 12, comprising, in responseto receiving the negative approval indication, adding the first metadataobject to a dispute queue, the negative approval indication associatedwith dispute reason information entered by the second user.
 14. Atangible non-transitory computer-readable medium comprising softwarecode adapted, when executed on a data processing apparatus, to perform amethod comprising the steps of: maintaining a data repository, the datarepository storing data imported from one or more data sources; storingand manacling, by a metadata management module, metadata, in a metadatarepository, relating to the data in the data repository; andconstructing, using a query builder interface, a first data query, usingfirst metadata from the metadata repository, for querying the data inthe data repository; storing the first data query in the metadatarepository; creating a first metadata object for the query in themetadata repository, and adding the first metadata object to adocumentation queue; constructing, using the query builder interface, asecond data query, using second metadata from the metadata repository,for querying the data in the data repository; storing the second dataquery in the metadata repository; creating a second metadata object forthe second data query in the metadata repository, and adding the secondmetadata object to the documentation queue; searching existing queriesbased on existing metadata objects stored in the metadata repository,the existing metadata objects including the first and second metadataobjects; selecting one of the existing data queries based on itsmetadata object; editing the selected data query to construct, using thequery builder interface, a third query using third metadata from themetadata repository, for querying the data in the data repository;storing the third data query in the metadata repository; and creating athird metadata object for the third data query in the metadatarepository, and adding the third metadata object to the documentationqueue, wherein the first, second and third metadata objects are storedin the metadata repository and are available for retrieval and executionor for retrieval and editing to create modified data queries.
 15. Anapparatus comprising a processor with associated memory storinginstructions arranged, when executed by the processor, to configure theprocessor to: maintain a data repository, the data repository storingdata imported from one or more data sources; store and manage, by ametadata management module, metadata, in a metadata repository, relatingto the data in the data repository; and construct, using a query builderinterface, a first data query, using first metadata from the metadatarepository, for querying the data in the data repository; store the dataquery in the metadata repository; create a first metadata object for thefirst data query in the metadata repository, and add the first metadataobject to a documentation queue; construct, using the query builderinterface, a second data query, using second metadata from the metadatarepository, for querying the data in the data repository; store thesecond data query in the metadata repository; create a second metadataobject for the second data query in the metadata repository, and add thesecond metadata object to the documentation queue; search existingqueries based on existing metadata objects stored in the metadatarepository, the existing metadata objects including the first and secondmetadata objects; select one of the existing data queries based on itsmetadata object; edit the selected data query to construct, using thequery builder interface, a third query using third metadata from themetadata repository, for querying the data in the data repository; storethe third data query in the metadata repository; and create a thirdmetadata object for the third data query in the metadata repository, andadd the third metadata object to the documentation queue, wherein thefirst, second and third metadata objects are stored in the metadatarepository and are available for retrieval and execution or forretrieval and editing to create modified data queries.